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

This page was generated on 2026-04-03 11:38 -0400 (Fri, 03 Apr 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_644.6.0 alpha (2026-03-30 r89742) 4894
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 258/2381HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-04-02 13:40 -0400 (Thu, 02 Apr 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
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-04-02 21:38:19 -0400 (Thu, 02 Apr 2026)
EndedAt: 2026-04-02 21:38:43 -0400 (Thu, 02 Apr 2026)
EllapsedTime: 24.1 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 version 4.6.0 alpha (2026-03-30 r89742)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
    gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
    GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
* running under: Ubuntu 24.04.4 LTS
* using session charset: UTF-8
* current time: 2026-04-03 01:38:19 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/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o
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 version 4.6.0 alpha (2026-03-30 r89742)
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.240   0.050   0.278 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.6.0 alpha (2026-03-30 r89742)
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 480181 25.7    1053160 56.3   637571 34.1
Vcells 887210  6.8    8388608 64.0  2083864 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] "Thu Apr  2 21:38:34 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Apr  2 21:38:34 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: 0x649eaa129380>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Apr  2 21:38:34 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Apr  2 21:38:34 2026"
> 
> ColMode(tmp2)
<pointer: 0x649eaa129380>
> 
> 
> 
> ### 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.8157424 0.2199824 -0.5491235  0.3231308
[2,]  0.5013313 0.2680338  2.1041606  0.5831865
[3,]  2.1997818 0.7763458  0.5951202 -0.9873637
[4,]  0.8804600 0.9902443  1.0101979  2.1263583
> 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.8157424 0.2199824 0.5491235 0.3231308
[2,]  0.5013313 0.2680338 2.1041606 0.5831865
[3,]  2.1997818 0.7763458 0.5951202 0.9873637
[4,]  0.8804600 0.9902443 1.0101979 2.1263583
> 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.9907829 0.4690228 0.7410287 0.5684460
[2,] 0.7080475 0.5177198 1.4505725 0.7636665
[3,] 1.4831661 0.8811049 0.7714403 0.9936618
[4,] 0.9383283 0.9951102 1.0050860 1.4582038
> 
> 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.72357 29.91021 32.95941 31.00759
[2,]  32.58181 30.44523 41.60989 33.21985
[3,]  42.03144 34.58739 33.30952 35.92398
[4,]  35.26374 35.94135 36.06106 41.70840
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x649eab845580>
> exp(tmp5)
<pointer: 0x649eab845580>
> log(tmp5,2)
<pointer: 0x649eab845580>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.7327
> Min(tmp5)
[1] 53.05262
> mean(tmp5)
[1] 71.61296
> Sum(tmp5)
[1] 14322.59
> Var(tmp5)
[1] 876.8441
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 87.76701 69.96109 73.94814 73.27572 67.70683 72.21805 66.51318 67.09516
 [9] 69.17197 68.47247
> rowSums(tmp5)
 [1] 1755.340 1399.222 1478.963 1465.514 1354.137 1444.361 1330.264 1341.903
 [9] 1383.439 1369.449
> rowVars(tmp5)
 [1] 8045.80872   46.44918   86.49189  105.50841   82.81011   85.07230
 [7]   70.94745  107.21467   97.55357   87.75969
> rowSd(tmp5)
 [1] 89.698432  6.815364  9.300102 10.271729  9.100006  9.223465  8.423031
 [8] 10.354451  9.876921  9.368014
> rowMax(tmp5)
 [1] 467.73267  86.60553  87.48294  92.00597  87.09856  86.61570  81.55413
 [8]  86.99668  86.34335  87.58188
> rowMin(tmp5)
 [1] 54.19261 60.47482 53.56909 56.77094 54.20967 54.91327 54.29185 53.05262
 [9] 53.38682 55.63741
> 
> colMeans(tmp5)
 [1] 115.49690  65.72098  70.11775  72.76706  67.20322  67.16312  65.81595
 [8]  67.93473  66.60578  74.54554  68.45824  73.16393  67.36626  74.34740
[15]  71.02337  71.01828  65.50550  71.24094  67.68659  69.07770
> colSums(tmp5)
 [1] 1154.9690  657.2098  701.1775  727.6706  672.0322  671.6312  658.1595
 [8]  679.3473  666.0578  745.4554  684.5824  731.6393  673.6626  743.4740
[15]  710.2337  710.1828  655.0550  712.4094  676.8659  690.7770
> colVars(tmp5)
 [1] 15418.84658    92.64098    91.88597    47.80449    85.74214    92.08908
 [7]    61.19563    61.31824    75.53433    17.87242   131.33144    81.18831
[13]    79.05378    81.55519    67.80221    88.83169    52.10066    90.72080
[19]   136.54858   109.49970
> colSd(tmp5)
 [1] 124.172648   9.625019   9.585717   6.914079   9.259705   9.596306
 [7]   7.822763   7.830596   8.691049   4.227579  11.459993   9.010456
[13]   8.891219   9.030791   8.234210   9.425057   7.218079   9.524747
[19]  11.685400  10.464210
> colMax(tmp5)
 [1] 467.73267  83.29329  86.60553  86.81056  83.76675  87.09856  76.06384
 [8]  79.61121  78.09236  82.35755  87.47668  87.37545  84.56641  86.54754
[15]  85.71907  87.58188  79.08013  92.00597  84.11795  82.85343
> colMin(tmp5)
 [1] 59.02686 54.29185 55.05329 64.53824 56.42224 57.12343 54.20967 57.91636
 [9] 53.05262 67.41915 53.56909 56.93669 56.77094 54.68439 59.43129 60.14751
[17] 56.48076 57.36027 53.38682 53.14839
> 
> 
> ### 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] 87.76701 69.96109 73.94814 73.27572       NA 72.21805 66.51318 67.09516
 [9] 69.17197 68.47247
> rowSums(tmp5)
 [1] 1755.340 1399.222 1478.963 1465.514       NA 1444.361 1330.264 1341.903
 [9] 1383.439 1369.449
> rowVars(tmp5)
 [1] 8045.80872   46.44918   86.49189  105.50841   81.15037   85.07230
 [7]   70.94745  107.21467   97.55357   87.75969
> rowSd(tmp5)
 [1] 89.698432  6.815364  9.300102 10.271729  9.008350  9.223465  8.423031
 [8] 10.354451  9.876921  9.368014
> rowMax(tmp5)
 [1] 467.73267  86.60553  87.48294  92.00597        NA  86.61570  81.55413
 [8]  86.99668  86.34335  87.58188
> rowMin(tmp5)
 [1] 54.19261 60.47482 53.56909 56.77094       NA 54.91327 54.29185 53.05262
 [9] 53.38682 55.63741
> 
> colMeans(tmp5)
 [1] 115.49690  65.72098  70.11775  72.76706  67.20322  67.16312  65.81595
 [8]  67.93473  66.60578  74.54554  68.45824  73.16393  67.36626  74.34740
[15]  71.02337  71.01828  65.50550        NA  67.68659  69.07770
> colSums(tmp5)
 [1] 1154.9690  657.2098  701.1775  727.6706  672.0322  671.6312  658.1595
 [8]  679.3473  666.0578  745.4554  684.5824  731.6393  673.6626  743.4740
[15]  710.2337  710.1828  655.0550        NA  676.8659  690.7770
> colVars(tmp5)
 [1] 15418.84658    92.64098    91.88597    47.80449    85.74214    92.08908
 [7]    61.19563    61.31824    75.53433    17.87242   131.33144    81.18831
[13]    79.05378    81.55519    67.80221    88.83169    52.10066          NA
[19]   136.54858   109.49970
> colSd(tmp5)
 [1] 124.172648   9.625019   9.585717   6.914079   9.259705   9.596306
 [7]   7.822763   7.830596   8.691049   4.227579  11.459993   9.010456
[13]   8.891219   9.030791   8.234210   9.425057   7.218079         NA
[19]  11.685400  10.464210
> colMax(tmp5)
 [1] 467.73267  83.29329  86.60553  86.81056  83.76675  87.09856  76.06384
 [8]  79.61121  78.09236  82.35755  87.47668  87.37545  84.56641  86.54754
[15]  85.71907  87.58188  79.08013        NA  84.11795  82.85343
> colMin(tmp5)
 [1] 59.02686 54.29185 55.05329 64.53824 56.42224 57.12343 54.20967 57.91636
 [9] 53.05262 67.41915 53.56909 56.93669 56.77094 54.68439 59.43129 60.14751
[17] 56.48076       NA 53.38682 53.14839
> 
> Max(tmp5,na.rm=TRUE)
[1] 467.7327
> Min(tmp5,na.rm=TRUE)
[1] 53.05262
> mean(tmp5,na.rm=TRUE)
[1] 71.68458
> Sum(tmp5,na.rm=TRUE)
[1] 14265.23
> Var(tmp5,na.rm=TRUE)
[1] 880.2415
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 87.76701 69.96109 73.94814 73.27572 68.25138 72.21805 66.51318 67.09516
 [9] 69.17197 68.47247
> rowSums(tmp5,na.rm=TRUE)
 [1] 1755.340 1399.222 1478.963 1465.514 1296.776 1444.361 1330.264 1341.903
 [9] 1383.439 1369.449
> rowVars(tmp5,na.rm=TRUE)
 [1] 8045.80872   46.44918   86.49189  105.50841   81.15037   85.07230
 [7]   70.94745  107.21467   97.55357   87.75969
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.698432  6.815364  9.300102 10.271729  9.008350  9.223465  8.423031
 [8] 10.354451  9.876921  9.368014
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.73267  86.60553  87.48294  92.00597  87.09856  86.61570  81.55413
 [8]  86.99668  86.34335  87.58188
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.19261 60.47482 53.56909 56.77094 54.20967 54.91327 54.29185 53.05262
 [9] 53.38682 55.63741
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 115.49690  65.72098  70.11775  72.76706  67.20322  67.16312  65.81595
 [8]  67.93473  66.60578  74.54554  68.45824  73.16393  67.36626  74.34740
[15]  71.02337  71.01828  65.50550  72.78324  67.68659  69.07770
> colSums(tmp5,na.rm=TRUE)
 [1] 1154.9690  657.2098  701.1775  727.6706  672.0322  671.6312  658.1595
 [8]  679.3473  666.0578  745.4554  684.5824  731.6393  673.6626  743.4740
[15]  710.2337  710.1828  655.0550  655.0491  676.8659  690.7770
> colVars(tmp5,na.rm=TRUE)
 [1] 15418.84658    92.64098    91.88597    47.80449    85.74214    92.08908
 [7]    61.19563    61.31824    75.53433    17.87242   131.33144    81.18831
[13]    79.05378    81.55519    67.80221    88.83169    52.10066    75.30077
[19]   136.54858   109.49970
> colSd(tmp5,na.rm=TRUE)
 [1] 124.172648   9.625019   9.585717   6.914079   9.259705   9.596306
 [7]   7.822763   7.830596   8.691049   4.227579  11.459993   9.010456
[13]   8.891219   9.030791   8.234210   9.425057   7.218079   8.677601
[19]  11.685400  10.464210
> colMax(tmp5,na.rm=TRUE)
 [1] 467.73267  83.29329  86.60553  86.81056  83.76675  87.09856  76.06384
 [8]  79.61121  78.09236  82.35755  87.47668  87.37545  84.56641  86.54754
[15]  85.71907  87.58188  79.08013  92.00597  84.11795  82.85343
> colMin(tmp5,na.rm=TRUE)
 [1] 59.02686 54.29185 55.05329 64.53824 56.42224 57.12343 54.20967 57.91636
 [9] 53.05262 67.41915 53.56909 56.93669 56.77094 54.68439 59.43129 60.14751
[17] 56.48076 63.92238 53.38682 53.14839
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 87.76701 69.96109 73.94814 73.27572      NaN 72.21805 66.51318 67.09516
 [9] 69.17197 68.47247
> rowSums(tmp5,na.rm=TRUE)
 [1] 1755.340 1399.222 1478.963 1465.514    0.000 1444.361 1330.264 1341.903
 [9] 1383.439 1369.449
> rowVars(tmp5,na.rm=TRUE)
 [1] 8045.80872   46.44918   86.49189  105.50841         NA   85.07230
 [7]   70.94745  107.21467   97.55357   87.75969
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.698432  6.815364  9.300102 10.271729        NA  9.223465  8.423031
 [8] 10.354451  9.876921  9.368014
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.73267  86.60553  87.48294  92.00597        NA  86.61570  81.55413
 [8]  86.99668  86.34335  87.58188
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.19261 60.47482 53.56909 56.77094       NA 54.91327 54.29185 53.05262
 [9] 53.38682 55.63741
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 121.77135  66.59795  71.39487  72.72639  66.03592  64.94807  67.10553
 [8]  67.80919  65.93417  74.27935  67.93727  73.36429  67.50751  73.73397
[15]  70.98245  72.08743  65.05781       NaN  68.83604  70.04671
> colSums(tmp5,na.rm=TRUE)
 [1] 1095.9422  599.3816  642.5538  654.5375  594.3233  584.5326  603.9498
 [8]  610.2827  593.4075  668.5141  611.4355  660.2786  607.5676  663.6058
[15]  638.8421  648.7869  585.5203    0.0000  619.5243  630.4204
> colVars(tmp5,na.rm=TRUE)
 [1] 16903.30430    95.56887    85.02252    53.76144    81.13074    48.40273
 [7]    50.13596    68.80571    79.90176    19.30930   144.69462    90.88525
[13]    88.71104    87.51634    76.25866    87.07582    56.35847          NA
[19]   138.75346   112.62362
> colSd(tmp5,na.rm=TRUE)
 [1] 130.012708   9.775933   9.220766   7.332220   9.007260   6.957207
 [7]   7.080675   8.294921   8.938779   4.394235  12.028908   9.533375
[13]   9.418654   9.355017   8.732620   9.331443   7.507228         NA
[19]  11.779366  10.612427
> colMax(tmp5,na.rm=TRUE)
 [1] 467.73267  83.29329  86.60553  86.81056  83.76675  78.14756  76.06384
 [8]  79.61121  78.09236  82.35755  87.47668  87.37545  84.56641  86.54754
[15]  85.71907  87.58188  79.08013      -Inf  84.11795  82.85343
> colMin(tmp5,na.rm=TRUE)
 [1] 67.81476 54.29185 55.05329 64.53824 56.42224 57.12343 54.91327 57.91636
 [9] 53.05262 67.41915 53.56909 56.93669 56.77094 54.68439 59.43129 60.14751
[17] 56.48076      Inf 53.38682 53.14839
> 
> 
> 
> 
> 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] 108.5336 199.2447 249.0357 233.4380 234.3277 227.5240 198.5066 278.4041
 [9] 268.9369 156.8502
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 108.5336 199.2447 249.0357 233.4380 234.3277 227.5240 198.5066 278.4041
 [9] 268.9369 156.8502
> 
> 
> 
> 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 -2.842171e-14  0.000000e+00  5.684342e-14 -1.136868e-13
 [6]  1.421085e-13 -2.273737e-13  0.000000e+00  8.526513e-14  5.684342e-14
[11]  8.526513e-14 -5.684342e-14  0.000000e+00  2.842171e-14  0.000000e+00
[16] -1.278977e-13  0.000000e+00  1.705303e-13  5.684342e-14  0.000000e+00
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## 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)
+ }
9   13 
3   8 
4   11 
6   5 
4   11 
2   16 
8   19 
6   19 
9   9 
3   19 
3   2 
2   18 
8   14 
6   16 
6   4 
9   10 
10   16 
2   12 
8   11 
8   1 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 1.851864
> Min(tmp)
[1] -2.675066
> mean(tmp)
[1] 0.009165986
> Sum(tmp)
[1] 0.9165986
> Var(tmp)
[1] 0.9621822
> 
> rowMeans(tmp)
[1] 0.009165986
> rowSums(tmp)
[1] 0.9165986
> rowVars(tmp)
[1] 0.9621822
> rowSd(tmp)
[1] 0.9809089
> rowMax(tmp)
[1] 1.851864
> rowMin(tmp)
[1] -2.675066
> 
> colMeans(tmp)
  [1] -0.206844599  0.357996141 -1.268734311 -1.094465523  1.813283140
  [6]  1.851864091 -1.017346748 -0.591369258 -0.809193214 -0.300704364
 [11] -0.589216814  1.613617341 -0.802472371  0.420719656  0.507170972
 [16]  0.443054325  1.549070455  1.028747168 -1.639261503  1.168613284
 [21]  0.256832790  1.452408896 -0.199714337 -1.654974908  0.529860081
 [26]  0.517995364  1.150167283 -0.333563829  0.068934380  0.297050335
 [31]  0.308533755  0.967353370  1.189324824  0.500749625 -0.311078751
 [36] -2.432268355 -0.218293868 -1.259312244  1.235918026  0.295276187
 [41] -0.043208710 -1.000908448 -1.182331847 -0.835199625  0.077191412
 [46]  0.741331743 -0.311510551 -0.892991329  0.776534609  0.316153493
 [51]  1.254370753  0.052133522 -0.991703139  0.543025828 -1.032200698
 [56] -2.675065860  0.550700804 -1.063334705 -0.938452708  0.521755798
 [61]  0.643147776 -1.078868502  1.543397062  0.939799761 -0.423225906
 [66]  1.360702451 -0.736422814 -0.237488059  0.297711541  1.067793101
 [71]  0.534726093 -2.270337258  0.748771847  0.466563094 -0.637651920
 [76] -0.168992309  0.598422135  0.279282141 -1.902869913  0.707031372
 [81]  1.013670654  0.455199991 -0.155118242 -0.778994952 -0.056700443
 [86] -1.245187281 -0.192319322  0.429555028  0.000228144  0.687547019
 [91] -0.637221308 -1.325243389  0.266535360  0.395019150  1.440992067
 [96] -1.870614990  0.657574080  1.096781789  0.411361553 -0.069974888
> colSums(tmp)
  [1] -0.206844599  0.357996141 -1.268734311 -1.094465523  1.813283140
  [6]  1.851864091 -1.017346748 -0.591369258 -0.809193214 -0.300704364
 [11] -0.589216814  1.613617341 -0.802472371  0.420719656  0.507170972
 [16]  0.443054325  1.549070455  1.028747168 -1.639261503  1.168613284
 [21]  0.256832790  1.452408896 -0.199714337 -1.654974908  0.529860081
 [26]  0.517995364  1.150167283 -0.333563829  0.068934380  0.297050335
 [31]  0.308533755  0.967353370  1.189324824  0.500749625 -0.311078751
 [36] -2.432268355 -0.218293868 -1.259312244  1.235918026  0.295276187
 [41] -0.043208710 -1.000908448 -1.182331847 -0.835199625  0.077191412
 [46]  0.741331743 -0.311510551 -0.892991329  0.776534609  0.316153493
 [51]  1.254370753  0.052133522 -0.991703139  0.543025828 -1.032200698
 [56] -2.675065860  0.550700804 -1.063334705 -0.938452708  0.521755798
 [61]  0.643147776 -1.078868502  1.543397062  0.939799761 -0.423225906
 [66]  1.360702451 -0.736422814 -0.237488059  0.297711541  1.067793101
 [71]  0.534726093 -2.270337258  0.748771847  0.466563094 -0.637651920
 [76] -0.168992309  0.598422135  0.279282141 -1.902869913  0.707031372
 [81]  1.013670654  0.455199991 -0.155118242 -0.778994952 -0.056700443
 [86] -1.245187281 -0.192319322  0.429555028  0.000228144  0.687547019
 [91] -0.637221308 -1.325243389  0.266535360  0.395019150  1.440992067
 [96] -1.870614990  0.657574080  1.096781789  0.411361553 -0.069974888
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -0.206844599  0.357996141 -1.268734311 -1.094465523  1.813283140
  [6]  1.851864091 -1.017346748 -0.591369258 -0.809193214 -0.300704364
 [11] -0.589216814  1.613617341 -0.802472371  0.420719656  0.507170972
 [16]  0.443054325  1.549070455  1.028747168 -1.639261503  1.168613284
 [21]  0.256832790  1.452408896 -0.199714337 -1.654974908  0.529860081
 [26]  0.517995364  1.150167283 -0.333563829  0.068934380  0.297050335
 [31]  0.308533755  0.967353370  1.189324824  0.500749625 -0.311078751
 [36] -2.432268355 -0.218293868 -1.259312244  1.235918026  0.295276187
 [41] -0.043208710 -1.000908448 -1.182331847 -0.835199625  0.077191412
 [46]  0.741331743 -0.311510551 -0.892991329  0.776534609  0.316153493
 [51]  1.254370753  0.052133522 -0.991703139  0.543025828 -1.032200698
 [56] -2.675065860  0.550700804 -1.063334705 -0.938452708  0.521755798
 [61]  0.643147776 -1.078868502  1.543397062  0.939799761 -0.423225906
 [66]  1.360702451 -0.736422814 -0.237488059  0.297711541  1.067793101
 [71]  0.534726093 -2.270337258  0.748771847  0.466563094 -0.637651920
 [76] -0.168992309  0.598422135  0.279282141 -1.902869913  0.707031372
 [81]  1.013670654  0.455199991 -0.155118242 -0.778994952 -0.056700443
 [86] -1.245187281 -0.192319322  0.429555028  0.000228144  0.687547019
 [91] -0.637221308 -1.325243389  0.266535360  0.395019150  1.440992067
 [96] -1.870614990  0.657574080  1.096781789  0.411361553 -0.069974888
> colMin(tmp)
  [1] -0.206844599  0.357996141 -1.268734311 -1.094465523  1.813283140
  [6]  1.851864091 -1.017346748 -0.591369258 -0.809193214 -0.300704364
 [11] -0.589216814  1.613617341 -0.802472371  0.420719656  0.507170972
 [16]  0.443054325  1.549070455  1.028747168 -1.639261503  1.168613284
 [21]  0.256832790  1.452408896 -0.199714337 -1.654974908  0.529860081
 [26]  0.517995364  1.150167283 -0.333563829  0.068934380  0.297050335
 [31]  0.308533755  0.967353370  1.189324824  0.500749625 -0.311078751
 [36] -2.432268355 -0.218293868 -1.259312244  1.235918026  0.295276187
 [41] -0.043208710 -1.000908448 -1.182331847 -0.835199625  0.077191412
 [46]  0.741331743 -0.311510551 -0.892991329  0.776534609  0.316153493
 [51]  1.254370753  0.052133522 -0.991703139  0.543025828 -1.032200698
 [56] -2.675065860  0.550700804 -1.063334705 -0.938452708  0.521755798
 [61]  0.643147776 -1.078868502  1.543397062  0.939799761 -0.423225906
 [66]  1.360702451 -0.736422814 -0.237488059  0.297711541  1.067793101
 [71]  0.534726093 -2.270337258  0.748771847  0.466563094 -0.637651920
 [76] -0.168992309  0.598422135  0.279282141 -1.902869913  0.707031372
 [81]  1.013670654  0.455199991 -0.155118242 -0.778994952 -0.056700443
 [86] -1.245187281 -0.192319322  0.429555028  0.000228144  0.687547019
 [91] -0.637221308 -1.325243389  0.266535360  0.395019150  1.440992067
 [96] -1.870614990  0.657574080  1.096781789  0.411361553 -0.069974888
> colMedians(tmp)
  [1] -0.206844599  0.357996141 -1.268734311 -1.094465523  1.813283140
  [6]  1.851864091 -1.017346748 -0.591369258 -0.809193214 -0.300704364
 [11] -0.589216814  1.613617341 -0.802472371  0.420719656  0.507170972
 [16]  0.443054325  1.549070455  1.028747168 -1.639261503  1.168613284
 [21]  0.256832790  1.452408896 -0.199714337 -1.654974908  0.529860081
 [26]  0.517995364  1.150167283 -0.333563829  0.068934380  0.297050335
 [31]  0.308533755  0.967353370  1.189324824  0.500749625 -0.311078751
 [36] -2.432268355 -0.218293868 -1.259312244  1.235918026  0.295276187
 [41] -0.043208710 -1.000908448 -1.182331847 -0.835199625  0.077191412
 [46]  0.741331743 -0.311510551 -0.892991329  0.776534609  0.316153493
 [51]  1.254370753  0.052133522 -0.991703139  0.543025828 -1.032200698
 [56] -2.675065860  0.550700804 -1.063334705 -0.938452708  0.521755798
 [61]  0.643147776 -1.078868502  1.543397062  0.939799761 -0.423225906
 [66]  1.360702451 -0.736422814 -0.237488059  0.297711541  1.067793101
 [71]  0.534726093 -2.270337258  0.748771847  0.466563094 -0.637651920
 [76] -0.168992309  0.598422135  0.279282141 -1.902869913  0.707031372
 [81]  1.013670654  0.455199991 -0.155118242 -0.778994952 -0.056700443
 [86] -1.245187281 -0.192319322  0.429555028  0.000228144  0.687547019
 [91] -0.637221308 -1.325243389  0.266535360  0.395019150  1.440992067
 [96] -1.870614990  0.657574080  1.096781789  0.411361553 -0.069974888
> colRanges(tmp)
           [,1]      [,2]      [,3]      [,4]     [,5]     [,6]      [,7]
[1,] -0.2068446 0.3579961 -1.268734 -1.094466 1.813283 1.851864 -1.017347
[2,] -0.2068446 0.3579961 -1.268734 -1.094466 1.813283 1.851864 -1.017347
           [,8]       [,9]      [,10]      [,11]    [,12]      [,13]     [,14]
[1,] -0.5913693 -0.8091932 -0.3007044 -0.5892168 1.613617 -0.8024724 0.4207197
[2,] -0.5913693 -0.8091932 -0.3007044 -0.5892168 1.613617 -0.8024724 0.4207197
        [,15]     [,16]   [,17]    [,18]     [,19]    [,20]     [,21]    [,22]
[1,] 0.507171 0.4430543 1.54907 1.028747 -1.639262 1.168613 0.2568328 1.452409
[2,] 0.507171 0.4430543 1.54907 1.028747 -1.639262 1.168613 0.2568328 1.452409
          [,23]     [,24]     [,25]     [,26]    [,27]      [,28]      [,29]
[1,] -0.1997143 -1.654975 0.5298601 0.5179954 1.150167 -0.3335638 0.06893438
[2,] -0.1997143 -1.654975 0.5298601 0.5179954 1.150167 -0.3335638 0.06893438
         [,30]     [,31]     [,32]    [,33]     [,34]      [,35]     [,36]
[1,] 0.2970503 0.3085338 0.9673534 1.189325 0.5007496 -0.3110788 -2.432268
[2,] 0.2970503 0.3085338 0.9673534 1.189325 0.5007496 -0.3110788 -2.432268
          [,37]     [,38]    [,39]     [,40]       [,41]     [,42]     [,43]
[1,] -0.2182939 -1.259312 1.235918 0.2952762 -0.04320871 -1.000908 -1.182332
[2,] -0.2182939 -1.259312 1.235918 0.2952762 -0.04320871 -1.000908 -1.182332
          [,44]      [,45]     [,46]      [,47]      [,48]     [,49]     [,50]
[1,] -0.8351996 0.07719141 0.7413317 -0.3115106 -0.8929913 0.7765346 0.3161535
[2,] -0.8351996 0.07719141 0.7413317 -0.3115106 -0.8929913 0.7765346 0.3161535
        [,51]      [,52]      [,53]     [,54]     [,55]     [,56]     [,57]
[1,] 1.254371 0.05213352 -0.9917031 0.5430258 -1.032201 -2.675066 0.5507008
[2,] 1.254371 0.05213352 -0.9917031 0.5430258 -1.032201 -2.675066 0.5507008
         [,58]      [,59]     [,60]     [,61]     [,62]    [,63]     [,64]
[1,] -1.063335 -0.9384527 0.5217558 0.6431478 -1.078869 1.543397 0.9397998
[2,] -1.063335 -0.9384527 0.5217558 0.6431478 -1.078869 1.543397 0.9397998
          [,65]    [,66]      [,67]      [,68]     [,69]    [,70]     [,71]
[1,] -0.4232259 1.360702 -0.7364228 -0.2374881 0.2977115 1.067793 0.5347261
[2,] -0.4232259 1.360702 -0.7364228 -0.2374881 0.2977115 1.067793 0.5347261
         [,72]     [,73]     [,74]      [,75]      [,76]     [,77]     [,78]
[1,] -2.270337 0.7487718 0.4665631 -0.6376519 -0.1689923 0.5984221 0.2792821
[2,] -2.270337 0.7487718 0.4665631 -0.6376519 -0.1689923 0.5984221 0.2792821
        [,79]     [,80]    [,81]  [,82]      [,83]     [,84]       [,85]
[1,] -1.90287 0.7070314 1.013671 0.4552 -0.1551182 -0.778995 -0.05670044
[2,] -1.90287 0.7070314 1.013671 0.4552 -0.1551182 -0.778995 -0.05670044
         [,86]      [,87]    [,88]       [,89]    [,90]      [,91]     [,92]
[1,] -1.245187 -0.1923193 0.429555 0.000228144 0.687547 -0.6372213 -1.325243
[2,] -1.245187 -0.1923193 0.429555 0.000228144 0.687547 -0.6372213 -1.325243
         [,93]     [,94]    [,95]     [,96]     [,97]    [,98]     [,99]
[1,] 0.2665354 0.3950192 1.440992 -1.870615 0.6575741 1.096782 0.4113616
[2,] 0.2665354 0.3950192 1.440992 -1.870615 0.6575741 1.096782 0.4113616
          [,100]
[1,] -0.06997489
[2,] -0.06997489
> 
> 
> Max(tmp2)
[1] 2.661917
> Min(tmp2)
[1] -1.8844
> mean(tmp2)
[1] 0.02490287
> Sum(tmp2)
[1] 2.490287
> Var(tmp2)
[1] 0.7788674
> 
> rowMeans(tmp2)
  [1]  0.260631542  0.600637586 -0.604014635  1.637818652 -0.971236174
  [6]  0.382182301  0.263693304  0.007963902  1.091866127 -0.212987574
 [11]  1.404087526  0.328011445 -0.697718169 -0.949409224  0.403651346
 [16]  0.119581524 -0.048108157  0.822510593 -1.884400367 -1.283247770
 [21]  0.856583563  0.914461888  1.273003677  0.952645100 -0.328110861
 [26]  0.019275123 -0.555504829 -0.939908303 -0.486162402 -1.252399182
 [31]  0.133986811 -0.071000732 -0.317820743  0.100437513 -0.334069268
 [36] -0.167090089  1.026212280 -0.280476873  1.860259135 -1.277336306
 [41]  0.347295397 -1.532649152  0.391047311  0.567499019  2.661916537
 [46] -1.126245011 -0.698045339 -0.322807135 -0.167143914 -1.360275378
 [51]  0.830214286 -0.244366919  0.141259509 -1.388004256 -0.441862716
 [56] -0.414430202  0.425837657 -0.689987852 -0.332509684  0.228462749
 [61]  1.116905878  0.566301619 -0.499867799 -0.891997630  0.392515621
 [66]  0.240300172 -0.615889746 -0.102703301 -0.981877147 -1.503826941
 [71]  1.047574735  1.434335100  1.377037652  1.338473246 -0.131367984
 [76] -1.778615238  1.181684538  0.831936371  0.130269007 -0.041857931
 [81]  0.168486874  0.238234128  0.405763413  0.701196386  0.556471721
 [86]  0.153954929  1.272683279  0.184243989  0.434823042  1.022196585
 [91] -0.875028362 -0.243406036  0.022469836 -1.766943823 -0.744011059
 [96] -0.277702131 -0.410181807  1.362546062 -1.036550622 -0.461993450
> rowSums(tmp2)
  [1]  0.260631542  0.600637586 -0.604014635  1.637818652 -0.971236174
  [6]  0.382182301  0.263693304  0.007963902  1.091866127 -0.212987574
 [11]  1.404087526  0.328011445 -0.697718169 -0.949409224  0.403651346
 [16]  0.119581524 -0.048108157  0.822510593 -1.884400367 -1.283247770
 [21]  0.856583563  0.914461888  1.273003677  0.952645100 -0.328110861
 [26]  0.019275123 -0.555504829 -0.939908303 -0.486162402 -1.252399182
 [31]  0.133986811 -0.071000732 -0.317820743  0.100437513 -0.334069268
 [36] -0.167090089  1.026212280 -0.280476873  1.860259135 -1.277336306
 [41]  0.347295397 -1.532649152  0.391047311  0.567499019  2.661916537
 [46] -1.126245011 -0.698045339 -0.322807135 -0.167143914 -1.360275378
 [51]  0.830214286 -0.244366919  0.141259509 -1.388004256 -0.441862716
 [56] -0.414430202  0.425837657 -0.689987852 -0.332509684  0.228462749
 [61]  1.116905878  0.566301619 -0.499867799 -0.891997630  0.392515621
 [66]  0.240300172 -0.615889746 -0.102703301 -0.981877147 -1.503826941
 [71]  1.047574735  1.434335100  1.377037652  1.338473246 -0.131367984
 [76] -1.778615238  1.181684538  0.831936371  0.130269007 -0.041857931
 [81]  0.168486874  0.238234128  0.405763413  0.701196386  0.556471721
 [86]  0.153954929  1.272683279  0.184243989  0.434823042  1.022196585
 [91] -0.875028362 -0.243406036  0.022469836 -1.766943823 -0.744011059
 [96] -0.277702131 -0.410181807  1.362546062 -1.036550622 -0.461993450
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  0.260631542  0.600637586 -0.604014635  1.637818652 -0.971236174
  [6]  0.382182301  0.263693304  0.007963902  1.091866127 -0.212987574
 [11]  1.404087526  0.328011445 -0.697718169 -0.949409224  0.403651346
 [16]  0.119581524 -0.048108157  0.822510593 -1.884400367 -1.283247770
 [21]  0.856583563  0.914461888  1.273003677  0.952645100 -0.328110861
 [26]  0.019275123 -0.555504829 -0.939908303 -0.486162402 -1.252399182
 [31]  0.133986811 -0.071000732 -0.317820743  0.100437513 -0.334069268
 [36] -0.167090089  1.026212280 -0.280476873  1.860259135 -1.277336306
 [41]  0.347295397 -1.532649152  0.391047311  0.567499019  2.661916537
 [46] -1.126245011 -0.698045339 -0.322807135 -0.167143914 -1.360275378
 [51]  0.830214286 -0.244366919  0.141259509 -1.388004256 -0.441862716
 [56] -0.414430202  0.425837657 -0.689987852 -0.332509684  0.228462749
 [61]  1.116905878  0.566301619 -0.499867799 -0.891997630  0.392515621
 [66]  0.240300172 -0.615889746 -0.102703301 -0.981877147 -1.503826941
 [71]  1.047574735  1.434335100  1.377037652  1.338473246 -0.131367984
 [76] -1.778615238  1.181684538  0.831936371  0.130269007 -0.041857931
 [81]  0.168486874  0.238234128  0.405763413  0.701196386  0.556471721
 [86]  0.153954929  1.272683279  0.184243989  0.434823042  1.022196585
 [91] -0.875028362 -0.243406036  0.022469836 -1.766943823 -0.744011059
 [96] -0.277702131 -0.410181807  1.362546062 -1.036550622 -0.461993450
> rowMin(tmp2)
  [1]  0.260631542  0.600637586 -0.604014635  1.637818652 -0.971236174
  [6]  0.382182301  0.263693304  0.007963902  1.091866127 -0.212987574
 [11]  1.404087526  0.328011445 -0.697718169 -0.949409224  0.403651346
 [16]  0.119581524 -0.048108157  0.822510593 -1.884400367 -1.283247770
 [21]  0.856583563  0.914461888  1.273003677  0.952645100 -0.328110861
 [26]  0.019275123 -0.555504829 -0.939908303 -0.486162402 -1.252399182
 [31]  0.133986811 -0.071000732 -0.317820743  0.100437513 -0.334069268
 [36] -0.167090089  1.026212280 -0.280476873  1.860259135 -1.277336306
 [41]  0.347295397 -1.532649152  0.391047311  0.567499019  2.661916537
 [46] -1.126245011 -0.698045339 -0.322807135 -0.167143914 -1.360275378
 [51]  0.830214286 -0.244366919  0.141259509 -1.388004256 -0.441862716
 [56] -0.414430202  0.425837657 -0.689987852 -0.332509684  0.228462749
 [61]  1.116905878  0.566301619 -0.499867799 -0.891997630  0.392515621
 [66]  0.240300172 -0.615889746 -0.102703301 -0.981877147 -1.503826941
 [71]  1.047574735  1.434335100  1.377037652  1.338473246 -0.131367984
 [76] -1.778615238  1.181684538  0.831936371  0.130269007 -0.041857931
 [81]  0.168486874  0.238234128  0.405763413  0.701196386  0.556471721
 [86]  0.153954929  1.272683279  0.184243989  0.434823042  1.022196585
 [91] -0.875028362 -0.243406036  0.022469836 -1.766943823 -0.744011059
 [96] -0.277702131 -0.410181807  1.362546062 -1.036550622 -0.461993450
> 
> colMeans(tmp2)
[1] 0.02490287
> colSums(tmp2)
[1] 2.490287
> colVars(tmp2)
[1] 0.7788674
> colSd(tmp2)
[1] 0.8825346
> colMax(tmp2)
[1] 2.661917
> colMin(tmp2)
[1] -1.8844
> colMedians(tmp2)
[1] 0.02087248
> colRanges(tmp2)
          [,1]
[1,] -1.884400
[2,]  2.661917
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.0663849  0.6983078  0.3311918  1.8586241  2.1834165 -1.2157855
 [7]  0.6267460 -2.5375230 -2.0286569 -6.0588771
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.0602821
[2,] -0.2511214
[3,]  0.3065634
[4,]  0.8254341
[5,]  1.7950049
> 
> rowApply(tmp,sum)
 [1]  2.3390114 -1.9202286 -8.3433434 -3.4511082 -0.2543244  1.5509048
 [7] -4.4322109  7.1878661  7.1854805 -3.9382187
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    8    4    8    7    7    8    9    4   10     1
 [2,]    9    7    1    4    6    3    2    2    9    10
 [3,]    1    9    9    5    2    6    8    1    7     9
 [4,]    3    8    7    6    5   10    4    6    4     6
 [5,]    6    5    6    8    9    5   10    3    5     4
 [6,]   10    1   10    3   10    1    5    8    2     5
 [7,]    4    3    4   10    4    7    6   10    6     2
 [8,]    5    2    2    9    3    2    3    5    8     8
 [9,]    7    6    5    1    8    4    7    7    3     3
[10,]    2   10    3    2    1    9    1    9    1     7
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -5.41289432 -4.51480185  0.71034992 -0.72917197  1.53525650 -0.78795018
 [7]  1.13206137  1.94311713  0.59037169 -1.84197338  3.91238682  2.54317103
[13]  1.36552484 -4.13085576  2.28211555  0.17791922  2.06618736  0.27104908
[19]  0.08130973 -1.22235482
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.73803183
[2,] -1.60969803
[3,] -1.17116071
[4,] -0.99102601
[5,]  0.09702226
> 
> rowApply(tmp,sum)
[1]  2.84412477 -0.01456071 -1.66200210  2.95308123 -4.14982522
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    3    1    1   13    6
[2,]    1    2   14    2    8
[3,]    8   14    9   14   17
[4,]   15   17   17    1    1
[5,]   16   11    3   17   16
> 
> 
> as.matrix(tmp)
            [,1]       [,2]       [,3]       [,4]        [,5]        [,6]
[1,] -1.17116071 -1.8640647 -0.1614449  0.5695326  1.08190029 -0.53159691
[2,] -1.73803183 -1.4460016  0.2171031  0.7759830  0.07263366  0.50255043
[3,] -1.60969803  0.5002152 -0.3322962  1.0859880 -1.40810377  0.57055385
[4,]  0.09702226 -0.8641819  0.1406571 -0.9796565  1.02659044 -0.00758448
[5,] -0.99102601 -0.8407689  0.8463309 -2.1810190  0.76223589 -1.32187307
             [,7]        [,8]        [,9]      [,10]      [,11]       [,12]
[1,]  0.370707268  1.75518322  0.32927197 -1.0442200  0.1870329 -0.67494573
[2,] -0.003359192  0.09805094 -0.01089903 -1.2350283  2.6795053  0.08064627
[3,]  1.088228736 -0.86101269 -0.62992691  0.3066418 -0.7977386  1.00950596
[4,]  0.761666458  0.04007138 -0.07330274 -0.4084945  1.3973499  1.41486967
[5,] -1.085181897  0.91082429  0.97522840  0.5391276  0.4462373  0.71309486
            [,13]      [,14]      [,15]      [,16]      [,17]      [,18]
[1,]  0.006092541 -0.0185942 -1.5035293  1.2692595  1.8277640  0.4184446
[2,] -0.890644271 -0.8931209  1.2446345  1.3340569 -0.3598176  0.7546807
[3,]  1.188449369 -1.6084506  1.3155367 -0.7063284  0.1946220 -0.2596986
[4,] -0.261757166 -0.2400383  1.5147521 -0.3573390 -0.2674963 -0.4644754
[5,]  1.323384367 -1.3706518 -0.2892785 -1.3617297  0.6711154 -0.1779022
          [,19]       [,20]
[1,]  2.6311322 -0.63263980
[2,] -1.1863556 -0.01114707
[3,] -0.4514587 -0.25703123
[4,] -0.1035620  0.58799022
[5,] -0.8084462 -0.90952694
> 
> 
> 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 :  653  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 :  565  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.6451517 -1.486159 -0.7618649 -1.416112 -0.1484615 0.1167016 0.06070573
          col8     col9     col10     col11      col12    col13      col14
row1 -2.653301 2.377327 0.3426134 -1.135321 -0.8599021 1.473343 -0.9572744
          col15     col16     col17     col18     col19      col20
row1 -0.6037974 0.8776536 -0.185149 0.8423104 0.8851658 -0.7944401
> tmp[,"col10"]
          col10
row1  0.3426134
row2  0.2840670
row3 -0.6822629
row4 -0.1602167
row5  0.7784068
> tmp[c("row1","row5"),]
           col1      col2       col3      col4       col5       col6
row1  0.6451517 -1.486159 -0.7618649 -1.416112 -0.1484615  0.1167016
row5 -0.4228324  1.615521  0.2132561  1.651551 -0.7479301 -1.0178178
            col7       col8      col9     col10      col11      col12     col13
row1  0.06070573 -2.6533010  2.377327 0.3426134 -1.1353210 -0.8599021  1.473343
row5 -1.72899524 -0.6773912 -1.840645 0.7784068 -0.3193972  0.7443999 -1.975423
          col14       col15      col16      col17     col18     col19
row1 -0.9572744 -0.60379742  0.8776536 -0.1851490 0.8423104 0.8851658
row5  0.2272426 -0.05396027 -0.7586418  0.2602309 1.1422097 0.7901926
          col20
row1 -0.7944401
row5 -0.0126969
> tmp[,c("col6","col20")]
           col6      col20
row1  0.1167016 -0.7944401
row2  1.6272720 -0.6602766
row3 -1.0053722  0.1477410
row4  1.8642321  1.5262700
row5 -1.0178178 -0.0126969
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1  0.1167016 -0.7944401
row5 -1.0178178 -0.0126969
> 
> 
> 
> 
> 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 48.42473 50.63117 49.97993 51.7499 49.49906 104.6066 49.82073 49.81165
        col9   col10   col11    col12   col13    col14    col15   col16
row1 49.4875 50.7876 48.4033 48.41284 49.6796 50.55821 49.78688 51.3844
        col17    col18    col19    col20
row1 49.53066 50.79233 50.57176 105.0697
> tmp[,"col10"]
        col10
row1 50.78760
row2 30.12299
row3 29.53215
row4 30.37370
row5 49.35779
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 48.42473 50.63117 49.97993 51.74990 49.49906 104.6066 49.82073 49.81165
row5 49.68373 50.81581 49.40308 50.19314 50.77920 105.1109 49.35467 49.72136
        col9    col10    col11    col12    col13    col14    col15    col16
row1 49.4875 50.78760 48.40330 48.41284 49.67960 50.55821 49.78688 51.38440
row5 50.5262 49.35779 49.87479 50.92479 50.59123 49.95755 50.88914 49.36187
        col17    col18    col19    col20
row1 49.53066 50.79233 50.57176 105.0697
row5 50.67090 49.32572 50.69042 103.7640
> tmp[,c("col6","col20")]
          col6     col20
row1 104.60655 105.06974
row2  76.43728  75.30107
row3  73.52619  76.29459
row4  75.50159  76.22351
row5 105.11087 103.76401
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.6066 105.0697
row5 105.1109 103.7640
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.6066 105.0697
row5 105.1109 103.7640
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.4381706
[2,]  1.8055770
[3,] -1.5999049
[4,] -0.2618324
[5,]  2.5904421
> tmp[,c("col17","col7")]
          col17        col7
[1,]  2.9967352  0.03314749
[2,]  0.3778520  0.55412965
[3,] -0.1401467 -0.13539898
[4,] -0.6110875 -0.47907794
[5,] -0.7334981  0.29421360
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6       col20
[1,] -0.12414667 -0.15766848
[2,]  0.98433333  0.05827269
[3,] -0.01042384 -0.48288572
[4,]  0.50180923 -0.28822753
[5,]  1.84159528 -0.98193392
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.1241467
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.1241467
[2,]  0.9843333
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]        [,3]        [,4]       [,5]      [,6]
row3 -1.3195975 -0.4555727 -1.25458875  0.45244478 -0.9038601 -0.560403
row1 -0.1723999 -0.6361126  0.04379847 -0.06432116  0.3892467  1.282467
           [,7]       [,8]       [,9]       [,10]      [,11]     [,12]
row3 0.07585361  0.5470588 -0.5679814 -1.63145452 -0.6607309 0.1919786
row1 2.19655352 -0.9990874  0.9860396 -0.05648017  0.1018216 0.1844163
          [,13]      [,14]       [,15]      [,16]      [,17]     [,18]
row3 -0.1726689  0.5754407 -0.07641894 -0.2789401 -0.1242184 1.4481732
row1 -1.3966743 -1.1423298 -2.54384184 -0.8964295 -2.4975908 0.5673285
          [,19]      [,20]
row3  1.4778276  0.2631340
row1 -0.5213122 -0.4048172
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]      [,2]      [,3]     [,4]      [,5]       [,6]        [,7]
row2 1.169027 -1.809598 -2.363961 1.173892 -0.527284 -0.2171419 -0.08823006
         [,8]      [,9]      [,10]
row2 2.053637 0.6929554 -0.5188772
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]      [,2]     [,3]      [,4]        [,5]      [,6]    [,7]
row5 1.405992 -1.342516 1.238452 0.5865209 -0.08463704 0.4840292 1.01321
          [,8]     [,9]      [,10]     [,11]    [,12]       [,13]     [,14]
row5 0.7581733 1.356364 -0.4201792 0.8409137 3.998768 0.003423997 -1.443048
         [,15]     [,16]     [,17]      [,18]    [,19]        [,20]
row5 0.3024099 0.1554983 -1.970683 -0.4877048 0.651658 -0.007520982
> 
> 
> 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: 0x649eaddbf900>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acd506a274f9b"
 [2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acd506d2dcf12"
 [3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acd5011dd99f9"
 [4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acd50f8bcf5a" 
 [5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acd501b14c080"
 [6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acd5012bd7d8b"
 [7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acd505f86b5ae"
 [8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acd50592b4894"
 [9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acd50187b8be1"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acd504d4d4f87"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acd5040e2acdb"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acd5058eb1dbf"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acd505f417c68"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acd505d59b115"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acd503b844b52"
> 
> 
> ### 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: 0x649eaa85b9c0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x649eaa85b9c0>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x649eaa85b9c0>
> rowMedians(tmp)
  [1] -0.0362763928 -0.0363104687 -0.3297638106  0.1675452399 -0.0722233379
  [6]  0.4148777177 -0.2552136183  0.0295407950  0.2933311467 -0.0079196452
 [11] -0.1660929640 -0.1955368181  0.3667527551 -0.2287418434 -0.1668297644
 [16]  0.1962191098  0.4342436960  0.5039810656 -0.5243121327 -0.0028178320
 [21]  0.1144155615  0.5142030489 -0.8389470246 -0.2543837913 -0.0181360514
 [26] -0.5680349302  0.4356525027  0.0969012021 -0.0734066824  0.3113064111
 [31] -0.4297256794  0.1756897805 -0.2645896267 -0.2463300675  0.1867721969
 [36]  0.4024307223  0.1596589689 -0.0252135542  0.5524303599 -0.3812714263
 [41] -0.7761913288  0.4410279141  0.0138336282 -0.3259282330 -0.6534290109
 [46] -0.2884461105  0.3341557380  0.2385326255 -0.0150980512 -0.1666792424
 [51] -0.0356351072  0.6246820944 -0.1119196005 -0.5069032367  0.1744371203
 [56] -0.0270123234 -0.1665177904  0.2798095099 -0.1423871923 -0.1144685656
 [61] -0.5971494663  0.3140772830  0.1149150523 -0.0808188003 -0.4409033781
 [66] -0.0415407357  0.0002155551  0.2255236619 -0.2384427882 -0.4736897865
 [71] -0.1345302081  0.0934602690 -0.7331241189  0.1613579770 -0.3286234391
 [76] -0.2471858681  0.0151106279 -0.2235283160 -0.5786010864 -0.0379930898
 [81]  0.0488941101  0.6454914463 -0.0114850460 -0.3344108342  0.6098867152
 [86] -0.3141581026  0.1998939275  0.3573948036  0.2566694358  0.1984400206
 [91]  0.0493255504  0.0415288270 -0.4454231444 -0.2052774833 -0.2180836789
 [96]  0.0346829400  0.1214577817  0.0782887342 -0.0339065137 -0.3136402672
[101]  0.7217514997 -0.5634059571  0.0993012164 -0.3663785358  0.2520674303
[106] -0.5511614055 -0.3179032642 -0.1148218619  0.2334173760 -0.6196811803
[111]  0.1970898684  0.5338279925  0.0560799682 -0.1021038344  0.4317594461
[116]  0.2461451928 -0.1034195037 -0.2486935242 -0.0078979514 -0.0652013198
[121] -0.2075367973 -0.1188750982 -0.3020048866 -0.2986611035  0.1948032611
[126]  0.2411762740 -0.0691318158 -0.1342350976 -0.1429730286 -0.2738022646
[131] -0.3795590283 -0.1915153296 -0.1415523387  0.0729159608 -0.2123212415
[136] -0.2070391275  0.0536733431  0.2031900671 -0.3989278438  0.2599713358
[141] -0.6001759245  0.0375457285 -0.1778953321  0.0047675661  0.2446989539
[146]  0.2189771468  0.1158375645  0.2814146436 -0.0187955512  0.4100513619
[151] -0.1309114562 -0.4672769771  0.4106124060  0.0817186426  0.1497971499
[156] -0.0128270662  0.1747581559 -0.0154836034  0.2553451312  0.4100612787
[161]  0.0424891232  0.0657803180 -0.1452621985 -0.0210029356  0.3735385238
[166] -0.0297352467  0.4994988036 -0.3920430260 -0.1307359970  0.3661507513
[171] -0.3739409130 -0.7839697032 -0.1169285188 -0.2655805329 -0.1276047636
[176]  0.0750305794  0.1378541905  0.4726519804  0.3873989739 -0.1970821495
[181] -0.0597477346  0.2072069059 -0.2569424403 -0.0173578065 -0.0579393077
[186] -0.0739714390 -0.8705730152  0.3603312379  0.1304840842 -0.1699281496
[191]  0.0477469258  0.4197759916  0.2231063368 -0.7100335477 -0.3003132836
[196]  0.1028331184  0.0613608424 -0.2148078430  0.1929771733  0.1346214617
[201]  0.0336014218  0.1799182843  0.5101004573 -0.4833483790 -0.1477443119
[206] -0.1081460547 -0.4820367017  0.0609852367  0.1626552288  0.0184583505
[211]  0.2544335683 -0.0746331114  0.1932455773  0.1786415700 -0.0379287569
[216] -0.0674909399 -0.0344465065  0.4107463608  0.1045395720  0.1523062443
[221] -0.2159858653 -0.4367599774  0.0918616689 -0.3908524641  0.0793942804
[226]  0.2046804135 -0.1659467783 -0.3875283149  0.5240884902  0.0456452965
> 
> proc.time()
   user  system elapsed 
  1.226   1.488   2.702 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.6.0 alpha (2026-03-30 r89742)
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: 0x5ea167391720>
> .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: 0x5ea167391720>
> .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: 0x5ea167391720>
> .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: 0x5ea167391720>
> 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: 0x5ea168078290>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5ea168078290>
> .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: 0x5ea168078290>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5ea168078290>
> .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: 0x5ea168078290>
> 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: 0x5ea166d35610>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5ea166d35610>
> .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: 0x5ea166d35610>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5ea166d35610>
> .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: 0x5ea166d35610>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x5ea166d35610>
> .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: 0x5ea166d35610>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x5ea166d35610>
> .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: 0x5ea166d35610>
> 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: 0x5ea167248ac0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5ea167248ac0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5ea167248ac0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5ea167248ac0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1acf261663ec00" "BufferedMatrixFile1acf2623b89c2f"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1acf261663ec00" "BufferedMatrixFile1acf2623b89c2f"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5ea167ec5530>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5ea167ec5530>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5ea167ec5530>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5ea167ec5530>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5ea167ec5530>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5ea167ec5530>
> .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: 0x5ea16695d380>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5ea16695d380>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5ea16695d380>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5ea16695d380>
> 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: 0x5ea166e2a3c0>
> .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: 0x5ea166e2a3c0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.235   0.059   0.281 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.6.0 alpha (2026-03-30 r89742)
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.236   0.042   0.266 

Example timings