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

This page was generated on 2026-02-25 11:32 -0500 (Wed, 25 Feb 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_64R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences" 4874
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 255/2354HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-02-24 13:40 -0500 (Tue, 24 Feb 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: ecdbf23
git_last_commit_date: 2025-10-29 09:58:55 -0500 (Wed, 29 Oct 2025)
nebbiolo1Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
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-02-24 22:03:25 -0500 (Tue, 24 Feb 2026)
EndedAt: 2026-02-24 22:03:53 -0500 (Tue, 24 Feb 2026)
EllapsedTime: 28.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 Under development (unstable) (2026-01-15 r89304)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
    gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
    GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
* running under: Ubuntu 24.04.3 LTS
* using session charset: UTF-8
* 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) 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) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function ‘dbm_ReadOnlyMode’:
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: ‘sort_double’ defined but not used [-Wunused-function]
 3327 | static int sort_double(const double *a1,const double *a2){
      |            ^~~~~~~~~~~
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c init_package.c -o init_package.o
gcc -std=gnu2x -shared -L/home/biocbuild/bbs-3.23-bioc/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/bbs-3.23-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.23-bioc/R/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.248   0.048   0.284 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 478920 25.6    1048721 56.1   639242 34.2
Vcells 885815  6.8    8388608 64.0  2083259 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] "Tue Feb 24 22:03:43 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue Feb 24 22:03:43 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: 0x631a413e7c10>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue Feb 24 22:03:44 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue Feb 24 22:03:44 2026"
> 
> ColMode(tmp2)
<pointer: 0x631a413e7c10>
> 
> 
> 
> ### 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.9692698  1.9326549  0.6308153  0.7841571
[2,]  0.8972725 -0.1373272  1.2489409 -1.6530720
[3,] -1.3397841  0.1006721 -0.2877064  1.4716186
[4,] -1.7055592  0.3491616 -0.8985088 -3.2800185
> 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.9692698 1.9326549 0.6308153 0.7841571
[2,]  0.8972725 0.1373272 1.2489409 1.6530720
[3,]  1.3397841 0.1006721 0.2877064 1.4716186
[4,]  1.7055592 0.3491616 0.8985088 3.2800185
> 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.9984634 1.3901996 0.7942388 0.8855264
[2,] 0.9472447 0.3705768 1.1175603 1.2857185
[3,] 1.1574904 0.3172887 0.5363827 1.2131029
[4,] 1.3059706 0.5908990 0.9478971 1.8110821
> 
> 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.95390 40.83465 33.57320 34.63942
[2,]  35.36972 28.84310 37.42454 39.51026
[3,]  37.91469 28.27356 30.65153 38.60265
[4,]  39.76527 31.25815 35.37748 46.39084
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x631a4223eff0>
> exp(tmp5)
<pointer: 0x631a4223eff0>
> log(tmp5,2)
<pointer: 0x631a4223eff0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.2121
> Min(tmp5)
[1] 54.07814
> mean(tmp5)
[1] 73.04799
> Sum(tmp5)
[1] 14609.6
> Var(tmp5)
[1] 872.1303
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 94.93191 69.27517 70.57867 72.65807 74.59814 68.43367 70.43579 69.42213
 [9] 70.69626 69.45010
> rowSums(tmp5)
 [1] 1898.638 1385.503 1411.573 1453.161 1491.963 1368.673 1408.716 1388.443
 [9] 1413.925 1389.002
> rowVars(tmp5)
 [1] 7792.24851   64.30722  114.97012  115.08886   61.11062   82.87298
 [7]  122.81368   62.32717   62.90707   64.68663
> rowSd(tmp5)
 [1] 88.273714  8.019178 10.722412 10.727948  7.817328  9.103460 11.082133
 [8]  7.894756  7.931398  8.042800
> rowMax(tmp5)
 [1] 468.21208  82.23542  92.95280  96.55645  86.25864  88.27340  93.90424
 [8]  82.65827  88.09815  86.46515
> rowMin(tmp5)
 [1] 64.82667 54.45661 54.51379 56.62568 62.20071 54.81845 54.07814 55.26556
 [9] 57.61718 56.60867
> 
> colMeans(tmp5)
 [1] 111.42248  71.99019  70.77283  76.95240  69.38243  71.35024  72.95528
 [8]  73.54591  67.24308  73.12433  71.90858  70.05125  68.01128  68.92302
[15]  69.61125  68.39858  76.58001  71.92872  66.84742  69.96054
> colSums(tmp5)
 [1] 1114.2248  719.9019  707.7283  769.5240  693.8243  713.5024  729.5528
 [8]  735.4591  672.4308  731.2433  719.0858  700.5125  680.1128  689.2302
[15]  696.1125  683.9858  765.8001  719.2872  668.4742  699.6054
> colVars(tmp5)
 [1] 15820.63773    78.15947    28.73560    98.89234   137.29612    71.41411
 [7]    86.73047    76.53291    74.71613    54.18392    82.33701    81.09499
[13]    18.94458    79.93405   121.58654    57.13726   160.06849    64.60381
[19]    69.78401   140.73956
> colSd(tmp5)
 [1] 125.780117   8.840784   5.360560   9.944463  11.717343   8.450687
 [7]   9.312919   8.748309   8.643849   7.360973   9.073974   9.005276
[13]   4.352538   8.940585  11.026629   7.558919  12.651818   8.037650
[19]   8.353683  11.863371
> colMax(tmp5)
 [1] 468.21208  84.99198  77.89428  96.55645  90.84109  87.15917  84.82090
 [8]  83.54699  79.49050  85.44913  86.25864  91.01974  73.35911  88.10614
[15]  92.95280  78.99259  94.57829  88.27340  83.15405  86.17928
> colMin(tmp5)
 [1] 56.60867 58.84771 62.20071 66.35359 54.81845 56.62568 56.68217 58.86949
 [9] 54.45661 59.32896 54.07814 59.32573 60.67986 57.22091 57.47087 54.51379
[17] 60.38051 60.98928 55.26556 54.51439
> 
> 
> ### 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] 94.93191 69.27517 70.57867 72.65807       NA 68.43367 70.43579 69.42213
 [9] 70.69626 69.45010
> rowSums(tmp5)
 [1] 1898.638 1385.503 1411.573 1453.161       NA 1368.673 1408.716 1388.443
 [9] 1413.925 1389.002
> rowVars(tmp5)
 [1] 7792.24851   64.30722  114.97012  115.08886   61.45374   82.87298
 [7]  122.81368   62.32717   62.90707   64.68663
> rowSd(tmp5)
 [1] 88.273714  8.019178 10.722412 10.727948  7.839244  9.103460 11.082133
 [8]  7.894756  7.931398  8.042800
> rowMax(tmp5)
 [1] 468.21208  82.23542  92.95280  96.55645        NA  88.27340  93.90424
 [8]  82.65827  88.09815  86.46515
> rowMin(tmp5)
 [1] 64.82667 54.45661 54.51379 56.62568       NA 54.81845 54.07814 55.26556
 [9] 57.61718 56.60867
> 
> colMeans(tmp5)
 [1] 111.42248  71.99019  70.77283  76.95240  69.38243  71.35024  72.95528
 [8]  73.54591  67.24308  73.12433  71.90858  70.05125  68.01128        NA
[15]  69.61125  68.39858  76.58001  71.92872  66.84742  69.96054
> colSums(tmp5)
 [1] 1114.2248  719.9019  707.7283  769.5240  693.8243  713.5024  729.5528
 [8]  735.4591  672.4308  731.2433  719.0858  700.5125  680.1128        NA
[15]  696.1125  683.9858  765.8001  719.2872  668.4742  699.6054
> colVars(tmp5)
 [1] 15820.63773    78.15947    28.73560    98.89234   137.29612    71.41411
 [7]    86.73047    76.53291    74.71613    54.18392    82.33701    81.09499
[13]    18.94458          NA   121.58654    57.13726   160.06849    64.60381
[19]    69.78401   140.73956
> colSd(tmp5)
 [1] 125.780117   8.840784   5.360560   9.944463  11.717343   8.450687
 [7]   9.312919   8.748309   8.643849   7.360973   9.073974   9.005276
[13]   4.352538         NA  11.026629   7.558919  12.651818   8.037650
[19]   8.353683  11.863371
> colMax(tmp5)
 [1] 468.21208  84.99198  77.89428  96.55645  90.84109  87.15917  84.82090
 [8]  83.54699  79.49050  85.44913  86.25864  91.01974  73.35911        NA
[15]  92.95280  78.99259  94.57829  88.27340  83.15405  86.17928
> colMin(tmp5)
 [1] 56.60867 58.84771 62.20071 66.35359 54.81845 56.62568 56.68217 58.86949
 [9] 54.45661 59.32896 54.07814 59.32573 60.67986       NA 57.47087 54.51379
[17] 60.38051 60.98928 55.26556 54.51439
> 
> Max(tmp5,na.rm=TRUE)
[1] 468.2121
> Min(tmp5,na.rm=TRUE)
[1] 54.07814
> mean(tmp5,na.rm=TRUE)
[1] 73.0765
> Sum(tmp5,na.rm=TRUE)
[1] 14542.22
> Var(tmp5,na.rm=TRUE)
[1] 876.3716
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 94.93191 69.27517 70.57867 72.65807 74.97836 68.43367 70.43579 69.42213
 [9] 70.69626 69.45010
> rowSums(tmp5,na.rm=TRUE)
 [1] 1898.638 1385.503 1411.573 1453.161 1424.589 1368.673 1408.716 1388.443
 [9] 1413.925 1389.002
> rowVars(tmp5,na.rm=TRUE)
 [1] 7792.24851   64.30722  114.97012  115.08886   61.45374   82.87298
 [7]  122.81368   62.32717   62.90707   64.68663
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.273714  8.019178 10.722412 10.727948  7.839244  9.103460 11.082133
 [8]  7.894756  7.931398  8.042800
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.21208  82.23542  92.95280  96.55645  86.25864  88.27340  93.90424
 [8]  82.65827  88.09815  86.46515
> rowMin(tmp5,na.rm=TRUE)
 [1] 64.82667 54.45661 54.51379 56.62568 62.20071 54.81845 54.07814 55.26556
 [9] 57.61718 56.60867
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.42248  71.99019  70.77283  76.95240  69.38243  71.35024  72.95528
 [8]  73.54591  67.24308  73.12433  71.90858  70.05125  68.01128  69.09513
[15]  69.61125  68.39858  76.58001  71.92872  66.84742  69.96054
> colSums(tmp5,na.rm=TRUE)
 [1] 1114.2248  719.9019  707.7283  769.5240  693.8243  713.5024  729.5528
 [8]  735.4591  672.4308  731.2433  719.0858  700.5125  680.1128  621.8562
[15]  696.1125  683.9858  765.8001  719.2872  668.4742  699.6054
> colVars(tmp5,na.rm=TRUE)
 [1] 15820.63773    78.15947    28.73560    98.89234   137.29612    71.41411
 [7]    86.73047    76.53291    74.71613    54.18392    82.33701    81.09499
[13]    18.94458    89.59257   121.58654    57.13726   160.06849    64.60381
[19]    69.78401   140.73956
> colSd(tmp5,na.rm=TRUE)
 [1] 125.780117   8.840784   5.360560   9.944463  11.717343   8.450687
 [7]   9.312919   8.748309   8.643849   7.360973   9.073974   9.005276
[13]   4.352538   9.465335  11.026629   7.558919  12.651818   8.037650
[19]   8.353683  11.863371
> colMax(tmp5,na.rm=TRUE)
 [1] 468.21208  84.99198  77.89428  96.55645  90.84109  87.15917  84.82090
 [8]  83.54699  79.49050  85.44913  86.25864  91.01974  73.35911  88.10614
[15]  92.95280  78.99259  94.57829  88.27340  83.15405  86.17928
> colMin(tmp5,na.rm=TRUE)
 [1] 56.60867 58.84771 62.20071 66.35359 54.81845 56.62568 56.68217 58.86949
 [9] 54.45661 59.32896 54.07814 59.32573 60.67986 57.22091 57.47087 54.51379
[17] 60.38051 60.98928 55.26556 54.51439
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 94.93191 69.27517 70.57867 72.65807      NaN 68.43367 70.43579 69.42213
 [9] 70.69626 69.45010
> rowSums(tmp5,na.rm=TRUE)
 [1] 1898.638 1385.503 1411.573 1453.161    0.000 1368.673 1408.716 1388.443
 [9] 1413.925 1389.002
> rowVars(tmp5,na.rm=TRUE)
 [1] 7792.24851   64.30722  114.97012  115.08886         NA   82.87298
 [7]  122.81368   62.32717   62.90707   64.68663
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.273714  8.019178 10.722412 10.727948        NA  9.103460 11.082133
 [8]  7.894756  7.931398  8.042800
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.21208  82.23542  92.95280  96.55645        NA  88.27340  93.90424
 [8]  82.65827  88.09815  86.46515
> rowMin(tmp5,na.rm=TRUE)
 [1] 64.82667 54.45661 54.51379 56.62568       NA 54.81845 54.07814 55.26556
 [9] 57.61718 56.60867
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.75078  71.26098  71.72529  77.96028  67.78684  71.11950  72.16601
 [8]  72.55149  66.92881  71.75491  70.31413  70.10352  67.49075       NaN
[15]  69.75768  68.83870  77.76282  72.33339  65.03557  68.77848
> colSums(tmp5,na.rm=TRUE)
 [1] 1032.7570  641.3488  645.5276  701.6425  610.0815  640.0755  649.4940
 [8]  652.9634  602.3593  645.7941  632.8272  630.9317  607.4167    0.0000
[15]  627.8191  619.5483  699.8654  651.0006  585.3201  619.0063
> colVars(tmp5,na.rm=TRUE)
 [1] 17673.59502    81.94733    22.12182    99.82582   125.81669    79.74191
 [7]    90.56354    74.97476    82.94451    39.85958    64.02857    91.20113
[13]    18.26437          NA   136.54365    62.10024   164.33788    70.83694
[19]    41.57559   142.61268
> colSd(tmp5,na.rm=TRUE)
 [1] 132.942074   9.052476   4.703384   9.991287  11.216804   8.929833
 [7]   9.516488   8.658797   9.107387   6.313444   8.001785   9.549928
[13]   4.273683         NA  11.685189   7.880370  12.819434   8.416468
[19]   6.447914  11.942055
> colMax(tmp5,na.rm=TRUE)
 [1] 468.21208  84.99198  77.89428  96.55645  90.84109  87.15917  84.82090
 [8]  83.54699  79.49050  82.67644  82.13197  91.01974  73.35911      -Inf
[15]  92.95280  78.99259  94.57829  88.27340  71.75651  86.17928
> colMin(tmp5,na.rm=TRUE)
 [1] 56.60867 58.84771 63.79715 66.35359 54.81845 56.62568 56.68217 58.86949
 [9] 54.45661 59.32896 54.07814 59.32573 60.67986      Inf 57.47087 54.51379
[17] 60.38051 60.98928 55.26556 54.51439
> 
> 
> 
> 
> 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] 219.4364 188.5587 209.8708 260.2215 282.4854 199.1304 286.7221 158.7418
 [9] 144.0693 199.3411
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 219.4364 188.5587 209.8708 260.2215 282.4854 199.1304 286.7221 158.7418
 [9] 144.0693 199.3411
> 
> 
> 
> 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]  2.273737e-13 -1.421085e-13 -8.526513e-14  1.421085e-13 -1.421085e-14
 [6] -8.526513e-14  5.684342e-14  5.684342e-14 -1.705303e-13  1.705303e-13
[11] -2.842171e-14  0.000000e+00  1.421085e-14 -2.842171e-14  0.000000e+00
[16] -1.421085e-14 -2.842171e-14  2.273737e-13  0.000000e+00  2.842171e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
1   12 
8   10 
7   15 
9   4 
6   9 
4   2 
8   2 
8   10 
7   1 
2   19 
2   13 
8   1 
1   3 
4   3 
10   19 
5   15 
4   16 
9   20 
9   8 
2   19 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.464678
> Min(tmp)
[1] -2.202964
> mean(tmp)
[1] 0.2049964
> Sum(tmp)
[1] 20.49964
> Var(tmp)
[1] 0.8097203
> 
> rowMeans(tmp)
[1] 0.2049964
> rowSums(tmp)
[1] 20.49964
> rowVars(tmp)
[1] 0.8097203
> rowSd(tmp)
[1] 0.8998446
> rowMax(tmp)
[1] 2.464678
> rowMin(tmp)
[1] -2.202964
> 
> colMeans(tmp)
  [1] -0.016583224  0.346003122 -1.213547720  0.841402313  1.007334591
  [6] -0.420564862  0.523926355 -1.152889432  1.459171451 -0.321130119
 [11]  0.038810419  0.636886263  1.229868917  0.459473419  1.361313593
 [16]  0.015472824  1.101320107 -0.644308875 -1.555546394  0.357114065
 [21]  1.930339697 -0.006955985  0.887062697 -1.156370451  0.432080461
 [26] -1.123623083  0.409917760  1.441208374  0.273490336  0.153035678
 [31] -0.474647796 -1.254330492 -0.143428826  0.403481863  1.349870902
 [36]  0.234757533  0.531967899  0.729239808 -1.301593076 -0.642067008
 [41] -0.086642975  1.072134105  0.548104075  0.866514218 -0.695113516
 [46] -1.282794160  1.262679292  0.465641141  0.329468754  0.371773358
 [51] -1.093637611  0.647197799  0.636909242  1.089547667 -0.667240712
 [56]  0.093723983 -0.612567421 -0.016463002 -1.048422073 -0.665079871
 [61] -2.202963650 -0.044422202  0.659727747 -0.498709603 -0.359148539
 [66]  0.453227127  0.902645755  1.898409872  0.145301293 -0.607350468
 [71] -0.388216396  1.056322226  0.096715564 -0.377605304  0.289336999
 [76] -0.294328104  0.171501425  1.083058800  1.041188552  2.191025519
 [81]  0.687619837 -0.459964100  1.140893208 -0.012650009 -1.085343234
 [86]  0.021763057  0.960615373  0.052395105  0.012337777 -0.599553512
 [91]  0.357263180  2.464677516  0.095136333  1.847668767  1.325510739
 [96]  0.806542680 -1.557116737  1.480851156 -0.133922163 -0.063494062
> colSums(tmp)
  [1] -0.016583224  0.346003122 -1.213547720  0.841402313  1.007334591
  [6] -0.420564862  0.523926355 -1.152889432  1.459171451 -0.321130119
 [11]  0.038810419  0.636886263  1.229868917  0.459473419  1.361313593
 [16]  0.015472824  1.101320107 -0.644308875 -1.555546394  0.357114065
 [21]  1.930339697 -0.006955985  0.887062697 -1.156370451  0.432080461
 [26] -1.123623083  0.409917760  1.441208374  0.273490336  0.153035678
 [31] -0.474647796 -1.254330492 -0.143428826  0.403481863  1.349870902
 [36]  0.234757533  0.531967899  0.729239808 -1.301593076 -0.642067008
 [41] -0.086642975  1.072134105  0.548104075  0.866514218 -0.695113516
 [46] -1.282794160  1.262679292  0.465641141  0.329468754  0.371773358
 [51] -1.093637611  0.647197799  0.636909242  1.089547667 -0.667240712
 [56]  0.093723983 -0.612567421 -0.016463002 -1.048422073 -0.665079871
 [61] -2.202963650 -0.044422202  0.659727747 -0.498709603 -0.359148539
 [66]  0.453227127  0.902645755  1.898409872  0.145301293 -0.607350468
 [71] -0.388216396  1.056322226  0.096715564 -0.377605304  0.289336999
 [76] -0.294328104  0.171501425  1.083058800  1.041188552  2.191025519
 [81]  0.687619837 -0.459964100  1.140893208 -0.012650009 -1.085343234
 [86]  0.021763057  0.960615373  0.052395105  0.012337777 -0.599553512
 [91]  0.357263180  2.464677516  0.095136333  1.847668767  1.325510739
 [96]  0.806542680 -1.557116737  1.480851156 -0.133922163 -0.063494062
> 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.016583224  0.346003122 -1.213547720  0.841402313  1.007334591
  [6] -0.420564862  0.523926355 -1.152889432  1.459171451 -0.321130119
 [11]  0.038810419  0.636886263  1.229868917  0.459473419  1.361313593
 [16]  0.015472824  1.101320107 -0.644308875 -1.555546394  0.357114065
 [21]  1.930339697 -0.006955985  0.887062697 -1.156370451  0.432080461
 [26] -1.123623083  0.409917760  1.441208374  0.273490336  0.153035678
 [31] -0.474647796 -1.254330492 -0.143428826  0.403481863  1.349870902
 [36]  0.234757533  0.531967899  0.729239808 -1.301593076 -0.642067008
 [41] -0.086642975  1.072134105  0.548104075  0.866514218 -0.695113516
 [46] -1.282794160  1.262679292  0.465641141  0.329468754  0.371773358
 [51] -1.093637611  0.647197799  0.636909242  1.089547667 -0.667240712
 [56]  0.093723983 -0.612567421 -0.016463002 -1.048422073 -0.665079871
 [61] -2.202963650 -0.044422202  0.659727747 -0.498709603 -0.359148539
 [66]  0.453227127  0.902645755  1.898409872  0.145301293 -0.607350468
 [71] -0.388216396  1.056322226  0.096715564 -0.377605304  0.289336999
 [76] -0.294328104  0.171501425  1.083058800  1.041188552  2.191025519
 [81]  0.687619837 -0.459964100  1.140893208 -0.012650009 -1.085343234
 [86]  0.021763057  0.960615373  0.052395105  0.012337777 -0.599553512
 [91]  0.357263180  2.464677516  0.095136333  1.847668767  1.325510739
 [96]  0.806542680 -1.557116737  1.480851156 -0.133922163 -0.063494062
> colMin(tmp)
  [1] -0.016583224  0.346003122 -1.213547720  0.841402313  1.007334591
  [6] -0.420564862  0.523926355 -1.152889432  1.459171451 -0.321130119
 [11]  0.038810419  0.636886263  1.229868917  0.459473419  1.361313593
 [16]  0.015472824  1.101320107 -0.644308875 -1.555546394  0.357114065
 [21]  1.930339697 -0.006955985  0.887062697 -1.156370451  0.432080461
 [26] -1.123623083  0.409917760  1.441208374  0.273490336  0.153035678
 [31] -0.474647796 -1.254330492 -0.143428826  0.403481863  1.349870902
 [36]  0.234757533  0.531967899  0.729239808 -1.301593076 -0.642067008
 [41] -0.086642975  1.072134105  0.548104075  0.866514218 -0.695113516
 [46] -1.282794160  1.262679292  0.465641141  0.329468754  0.371773358
 [51] -1.093637611  0.647197799  0.636909242  1.089547667 -0.667240712
 [56]  0.093723983 -0.612567421 -0.016463002 -1.048422073 -0.665079871
 [61] -2.202963650 -0.044422202  0.659727747 -0.498709603 -0.359148539
 [66]  0.453227127  0.902645755  1.898409872  0.145301293 -0.607350468
 [71] -0.388216396  1.056322226  0.096715564 -0.377605304  0.289336999
 [76] -0.294328104  0.171501425  1.083058800  1.041188552  2.191025519
 [81]  0.687619837 -0.459964100  1.140893208 -0.012650009 -1.085343234
 [86]  0.021763057  0.960615373  0.052395105  0.012337777 -0.599553512
 [91]  0.357263180  2.464677516  0.095136333  1.847668767  1.325510739
 [96]  0.806542680 -1.557116737  1.480851156 -0.133922163 -0.063494062
> colMedians(tmp)
  [1] -0.016583224  0.346003122 -1.213547720  0.841402313  1.007334591
  [6] -0.420564862  0.523926355 -1.152889432  1.459171451 -0.321130119
 [11]  0.038810419  0.636886263  1.229868917  0.459473419  1.361313593
 [16]  0.015472824  1.101320107 -0.644308875 -1.555546394  0.357114065
 [21]  1.930339697 -0.006955985  0.887062697 -1.156370451  0.432080461
 [26] -1.123623083  0.409917760  1.441208374  0.273490336  0.153035678
 [31] -0.474647796 -1.254330492 -0.143428826  0.403481863  1.349870902
 [36]  0.234757533  0.531967899  0.729239808 -1.301593076 -0.642067008
 [41] -0.086642975  1.072134105  0.548104075  0.866514218 -0.695113516
 [46] -1.282794160  1.262679292  0.465641141  0.329468754  0.371773358
 [51] -1.093637611  0.647197799  0.636909242  1.089547667 -0.667240712
 [56]  0.093723983 -0.612567421 -0.016463002 -1.048422073 -0.665079871
 [61] -2.202963650 -0.044422202  0.659727747 -0.498709603 -0.359148539
 [66]  0.453227127  0.902645755  1.898409872  0.145301293 -0.607350468
 [71] -0.388216396  1.056322226  0.096715564 -0.377605304  0.289336999
 [76] -0.294328104  0.171501425  1.083058800  1.041188552  2.191025519
 [81]  0.687619837 -0.459964100  1.140893208 -0.012650009 -1.085343234
 [86]  0.021763057  0.960615373  0.052395105  0.012337777 -0.599553512
 [91]  0.357263180  2.464677516  0.095136333  1.847668767  1.325510739
 [96]  0.806542680 -1.557116737  1.480851156 -0.133922163 -0.063494062
> colRanges(tmp)
            [,1]      [,2]      [,3]      [,4]     [,5]       [,6]      [,7]
[1,] -0.01658322 0.3460031 -1.213548 0.8414023 1.007335 -0.4205649 0.5239264
[2,] -0.01658322 0.3460031 -1.213548 0.8414023 1.007335 -0.4205649 0.5239264
          [,8]     [,9]      [,10]      [,11]     [,12]    [,13]     [,14]
[1,] -1.152889 1.459171 -0.3211301 0.03881042 0.6368863 1.229869 0.4594734
[2,] -1.152889 1.459171 -0.3211301 0.03881042 0.6368863 1.229869 0.4594734
        [,15]      [,16]   [,17]      [,18]     [,19]     [,20]   [,21]
[1,] 1.361314 0.01547282 1.10132 -0.6443089 -1.555546 0.3571141 1.93034
[2,] 1.361314 0.01547282 1.10132 -0.6443089 -1.555546 0.3571141 1.93034
            [,22]     [,23]    [,24]     [,25]     [,26]     [,27]    [,28]
[1,] -0.006955985 0.8870627 -1.15637 0.4320805 -1.123623 0.4099178 1.441208
[2,] -0.006955985 0.8870627 -1.15637 0.4320805 -1.123623 0.4099178 1.441208
         [,29]     [,30]      [,31]    [,32]      [,33]     [,34]    [,35]
[1,] 0.2734903 0.1530357 -0.4746478 -1.25433 -0.1434288 0.4034819 1.349871
[2,] 0.2734903 0.1530357 -0.4746478 -1.25433 -0.1434288 0.4034819 1.349871
         [,36]     [,37]     [,38]     [,39]     [,40]       [,41]    [,42]
[1,] 0.2347575 0.5319679 0.7292398 -1.301593 -0.642067 -0.08664297 1.072134
[2,] 0.2347575 0.5319679 0.7292398 -1.301593 -0.642067 -0.08664297 1.072134
         [,43]     [,44]      [,45]     [,46]    [,47]     [,48]     [,49]
[1,] 0.5481041 0.8665142 -0.6951135 -1.282794 1.262679 0.4656411 0.3294688
[2,] 0.5481041 0.8665142 -0.6951135 -1.282794 1.262679 0.4656411 0.3294688
         [,50]     [,51]     [,52]     [,53]    [,54]      [,55]      [,56]
[1,] 0.3717734 -1.093638 0.6471978 0.6369092 1.089548 -0.6672407 0.09372398
[2,] 0.3717734 -1.093638 0.6471978 0.6369092 1.089548 -0.6672407 0.09372398
          [,57]     [,58]     [,59]      [,60]     [,61]      [,62]     [,63]
[1,] -0.6125674 -0.016463 -1.048422 -0.6650799 -2.202964 -0.0444222 0.6597277
[2,] -0.6125674 -0.016463 -1.048422 -0.6650799 -2.202964 -0.0444222 0.6597277
          [,64]      [,65]     [,66]     [,67]   [,68]     [,69]      [,70]
[1,] -0.4987096 -0.3591485 0.4532271 0.9026458 1.89841 0.1453013 -0.6073505
[2,] -0.4987096 -0.3591485 0.4532271 0.9026458 1.89841 0.1453013 -0.6073505
          [,71]    [,72]      [,73]      [,74]    [,75]      [,76]     [,77]
[1,] -0.3882164 1.056322 0.09671556 -0.3776053 0.289337 -0.2943281 0.1715014
[2,] -0.3882164 1.056322 0.09671556 -0.3776053 0.289337 -0.2943281 0.1715014
        [,78]    [,79]    [,80]     [,81]      [,82]    [,83]       [,84]
[1,] 1.083059 1.041189 2.191026 0.6876198 -0.4599641 1.140893 -0.01265001
[2,] 1.083059 1.041189 2.191026 0.6876198 -0.4599641 1.140893 -0.01265001
         [,85]      [,86]     [,87]     [,88]      [,89]      [,90]     [,91]
[1,] -1.085343 0.02176306 0.9606154 0.0523951 0.01233778 -0.5995535 0.3572632
[2,] -1.085343 0.02176306 0.9606154 0.0523951 0.01233778 -0.5995535 0.3572632
        [,92]      [,93]    [,94]    [,95]     [,96]     [,97]    [,98]
[1,] 2.464678 0.09513633 1.847669 1.325511 0.8065427 -1.557117 1.480851
[2,] 2.464678 0.09513633 1.847669 1.325511 0.8065427 -1.557117 1.480851
          [,99]      [,100]
[1,] -0.1339222 -0.06349406
[2,] -0.1339222 -0.06349406
> 
> 
> Max(tmp2)
[1] 2.321815
> Min(tmp2)
[1] -2.233777
> mean(tmp2)
[1] -0.001930628
> Sum(tmp2)
[1] -0.1930628
> Var(tmp2)
[1] 1.109269
> 
> rowMeans(tmp2)
  [1] -1.285832348  1.068766457 -1.278468943 -0.581897511 -0.015227547
  [6] -2.233776529  0.734830706 -0.058664146  0.208316863 -0.734700734
 [11] -0.592604985  1.659379291 -0.398432823 -1.299902333  1.850021756
 [16]  0.861217648 -0.210999691  0.691454030  0.203219420  0.487180398
 [21]  0.860529090 -0.260092135  1.322819401  0.270576461 -1.510089414
 [26] -0.168446763  0.945333096  0.383804512 -0.239702039  0.831310539
 [31]  0.106741556  0.813303050  0.001225186  1.166783712 -0.624830945
 [36]  1.505191333  0.554456323 -0.722069409  1.654148550 -1.098496625
 [41]  0.634955578 -1.018543502  1.209114384 -0.124992942  0.417587454
 [46]  0.295388502 -1.784848500 -0.475363135 -1.079117795  2.039612671
 [51]  0.271584009  0.567385385 -1.722173894  0.281059519  0.064965793
 [56]  1.511993811  1.275480210  1.208851082 -1.213768520 -1.188467436
 [61] -1.966109905  0.169120484 -0.012143327 -0.160316498  0.258894096
 [66] -0.026745287 -0.985039121 -0.253887555 -1.290294248 -0.996871460
 [71] -0.788201859 -0.846342581 -1.724304684  0.878778949  1.791677834
 [76] -0.426339159  1.940346497  1.849719299 -0.451124238  0.713851282
 [81]  0.033699682  0.531557187 -0.192785578 -1.846572364 -0.993606583
 [86]  0.706070225  2.321815135  2.167688774  0.089872535  0.338087376
 [91] -0.509867074 -0.933476345 -0.184269143 -1.126341210 -1.973577678
 [96] -1.304665984  0.357616524 -1.134157599  0.220890325 -0.472786648
> rowSums(tmp2)
  [1] -1.285832348  1.068766457 -1.278468943 -0.581897511 -0.015227547
  [6] -2.233776529  0.734830706 -0.058664146  0.208316863 -0.734700734
 [11] -0.592604985  1.659379291 -0.398432823 -1.299902333  1.850021756
 [16]  0.861217648 -0.210999691  0.691454030  0.203219420  0.487180398
 [21]  0.860529090 -0.260092135  1.322819401  0.270576461 -1.510089414
 [26] -0.168446763  0.945333096  0.383804512 -0.239702039  0.831310539
 [31]  0.106741556  0.813303050  0.001225186  1.166783712 -0.624830945
 [36]  1.505191333  0.554456323 -0.722069409  1.654148550 -1.098496625
 [41]  0.634955578 -1.018543502  1.209114384 -0.124992942  0.417587454
 [46]  0.295388502 -1.784848500 -0.475363135 -1.079117795  2.039612671
 [51]  0.271584009  0.567385385 -1.722173894  0.281059519  0.064965793
 [56]  1.511993811  1.275480210  1.208851082 -1.213768520 -1.188467436
 [61] -1.966109905  0.169120484 -0.012143327 -0.160316498  0.258894096
 [66] -0.026745287 -0.985039121 -0.253887555 -1.290294248 -0.996871460
 [71] -0.788201859 -0.846342581 -1.724304684  0.878778949  1.791677834
 [76] -0.426339159  1.940346497  1.849719299 -0.451124238  0.713851282
 [81]  0.033699682  0.531557187 -0.192785578 -1.846572364 -0.993606583
 [86]  0.706070225  2.321815135  2.167688774  0.089872535  0.338087376
 [91] -0.509867074 -0.933476345 -0.184269143 -1.126341210 -1.973577678
 [96] -1.304665984  0.357616524 -1.134157599  0.220890325 -0.472786648
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -1.285832348  1.068766457 -1.278468943 -0.581897511 -0.015227547
  [6] -2.233776529  0.734830706 -0.058664146  0.208316863 -0.734700734
 [11] -0.592604985  1.659379291 -0.398432823 -1.299902333  1.850021756
 [16]  0.861217648 -0.210999691  0.691454030  0.203219420  0.487180398
 [21]  0.860529090 -0.260092135  1.322819401  0.270576461 -1.510089414
 [26] -0.168446763  0.945333096  0.383804512 -0.239702039  0.831310539
 [31]  0.106741556  0.813303050  0.001225186  1.166783712 -0.624830945
 [36]  1.505191333  0.554456323 -0.722069409  1.654148550 -1.098496625
 [41]  0.634955578 -1.018543502  1.209114384 -0.124992942  0.417587454
 [46]  0.295388502 -1.784848500 -0.475363135 -1.079117795  2.039612671
 [51]  0.271584009  0.567385385 -1.722173894  0.281059519  0.064965793
 [56]  1.511993811  1.275480210  1.208851082 -1.213768520 -1.188467436
 [61] -1.966109905  0.169120484 -0.012143327 -0.160316498  0.258894096
 [66] -0.026745287 -0.985039121 -0.253887555 -1.290294248 -0.996871460
 [71] -0.788201859 -0.846342581 -1.724304684  0.878778949  1.791677834
 [76] -0.426339159  1.940346497  1.849719299 -0.451124238  0.713851282
 [81]  0.033699682  0.531557187 -0.192785578 -1.846572364 -0.993606583
 [86]  0.706070225  2.321815135  2.167688774  0.089872535  0.338087376
 [91] -0.509867074 -0.933476345 -0.184269143 -1.126341210 -1.973577678
 [96] -1.304665984  0.357616524 -1.134157599  0.220890325 -0.472786648
> rowMin(tmp2)
  [1] -1.285832348  1.068766457 -1.278468943 -0.581897511 -0.015227547
  [6] -2.233776529  0.734830706 -0.058664146  0.208316863 -0.734700734
 [11] -0.592604985  1.659379291 -0.398432823 -1.299902333  1.850021756
 [16]  0.861217648 -0.210999691  0.691454030  0.203219420  0.487180398
 [21]  0.860529090 -0.260092135  1.322819401  0.270576461 -1.510089414
 [26] -0.168446763  0.945333096  0.383804512 -0.239702039  0.831310539
 [31]  0.106741556  0.813303050  0.001225186  1.166783712 -0.624830945
 [36]  1.505191333  0.554456323 -0.722069409  1.654148550 -1.098496625
 [41]  0.634955578 -1.018543502  1.209114384 -0.124992942  0.417587454
 [46]  0.295388502 -1.784848500 -0.475363135 -1.079117795  2.039612671
 [51]  0.271584009  0.567385385 -1.722173894  0.281059519  0.064965793
 [56]  1.511993811  1.275480210  1.208851082 -1.213768520 -1.188467436
 [61] -1.966109905  0.169120484 -0.012143327 -0.160316498  0.258894096
 [66] -0.026745287 -0.985039121 -0.253887555 -1.290294248 -0.996871460
 [71] -0.788201859 -0.846342581 -1.724304684  0.878778949  1.791677834
 [76] -0.426339159  1.940346497  1.849719299 -0.451124238  0.713851282
 [81]  0.033699682  0.531557187 -0.192785578 -1.846572364 -0.993606583
 [86]  0.706070225  2.321815135  2.167688774  0.089872535  0.338087376
 [91] -0.509867074 -0.933476345 -0.184269143 -1.126341210 -1.973577678
 [96] -1.304665984  0.357616524 -1.134157599  0.220890325 -0.472786648
> 
> colMeans(tmp2)
[1] -0.001930628
> colSums(tmp2)
[1] -0.1930628
> colVars(tmp2)
[1] 1.109269
> colSd(tmp2)
[1] 1.053218
> colMax(tmp2)
[1] 2.321815
> colMin(tmp2)
[1] -2.233777
> colMedians(tmp2)
[1] -0.005459071
> colRanges(tmp2)
          [,1]
[1,] -2.233777
[2,]  2.321815
> 
> 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.738617322  0.006701725 -0.709274610  3.354304703 -3.615965488
 [6]  5.690389901 -1.674452244  2.099525978 -0.053259724 -4.835963252
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -3.04841873
[2,] -1.21900357
[3,]  0.01399602
[4,]  0.65740500
[5,]  2.07421119
> 
> rowApply(tmp,sum)
 [1] -2.6331021 -1.3023188  1.9768499  5.7751960  5.3047225 -0.4767552
 [7] -7.3888762 -3.0964764 -3.2566961  2.6208460
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    8    7    3    9    1    1   10    6     3
 [2,]    9    1    5    1    4    4    9    9    3     7
 [3,]    4    9    9    7    1    5    4    7    7     1
 [4,]    2    7   10    6    3    3    8    6    8    10
 [5,]    6   10    2    4    2    6    3    1    2     6
 [6,]   10    6    3    5    6    8    7    5   10     8
 [7,]    5    3    4    2    5    2    5    8    1     9
 [8,]    8    4    8    9   10    7   10    4    4     5
 [9,]    7    5    6   10    8   10    2    2    9     2
[10,]    3    2    1    8    7    9    6    3    5     4
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.04844463  4.48489530 -1.38260254  0.28112568  2.99475937  0.65062938
 [7]  1.90797737  0.11241309  1.90054318  0.67449267  0.65200202  3.03360550
[13]  3.25856713 -0.08249033 -0.39039031  4.48694615 -4.56312916  0.57901164
[19]  0.49858357 -0.42225369
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.8100657
[2,] -0.4886951
[3,]  0.1988041
[4,]  0.4241835
[5,]  0.6273285
> 
> rowApply(tmp,sum)
[1] 7.254270 1.283072 3.085282 3.621229 3.382389
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    9    7   13   16    5
[2,]   17   20    2   18   18
[3,]    2    2    8   10   16
[4,]   12    8    9   12    7
[5,]   15   16   16    8   14
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]        [,5]       [,6]
[1,]  0.1988041  0.7733518 -0.7077439  0.6390747  0.73490409  0.6883931
[2,] -0.4886951  2.0044147 -1.5468335 -0.1925014  0.97114523  1.6906846
[3,]  0.4241835 -0.9777991 -0.2244484 -0.1017392  0.60483862 -1.5893597
[4,]  0.6273285  1.1957735  0.1875859  0.2425989 -0.03653167 -0.5673989
[5,] -0.8100657  1.4891544  0.9088373 -0.3063072  0.72040311  0.4283103
            [,7]       [,8]        [,9]      [,10]      [,11]      [,12]
[1,] -0.12695720 -0.6687217  1.17506479  0.2537037 -0.2336769  2.0694356
[2,] -0.06211598 -0.9058730  0.05803031  0.8262999 -0.7287025  1.0702871
[3,]  1.57924377  0.4026487  0.44624876 -0.3257022 -0.4753183 -0.3620395
[4,]  0.85539635  0.3846674  1.31450337 -1.2340144  0.1813291 -0.3165117
[5,] -0.33758958  0.8996917 -1.09330405  1.1542055  1.9083707  0.5724340
          [,13]      [,14]       [,15]       [,16]      [,17]       [,18]
[1,]  0.4691198  0.6511174  0.01198694  1.95118752 -0.6078208  0.02720922
[2,]  0.3050997  1.0461294 -1.24946045  0.72459042 -2.0280857  0.83877252
[3,]  0.7667839  0.1633142 -0.26748745  1.58488567  0.4294694 -0.04321127
[4,]  2.0008549 -0.2212439 -0.44605679  0.31750427 -1.3398003 -0.22732624
[5,] -0.2832912 -1.7218074  1.56062744 -0.09122173 -1.0168918 -0.01643259
          [,19]      [,20]
[1,]  0.7441730 -0.7883355
[2,] -1.1700728  0.1199587
[3,] -0.2750392  1.3258092
[4,]  0.4812392  0.2213315
[5,]  0.7182834 -1.3010177
> 
> 
> 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.03496159 0.5289047 2.777348 1.329298 1.904468 -0.7722051 -0.8281112
          col8      col9     col10       col11     col12     col13     col14
row1 -0.183513 -1.951884 -1.161365 -0.05746576 -1.362813 0.6964863 -1.089734
          col15      col16      col17     col18      col19     col20
row1 -0.2226396 -0.5109971 0.01719182 0.3744059 -0.7647721 0.9640789
> tmp[,"col10"]
          col10
row1 -1.1613650
row2 -0.3561795
row3 -0.6674430
row4 -0.4077458
row5  0.9241209
> tmp[c("row1","row5"),]
           col1       col2     col3       col4        col5       col6
row1 0.03496159  0.5289047 2.777348  1.3292978  1.90446783 -0.7722051
row5 0.01539380 -0.3327791 1.620289 -0.8931916 -0.08431747  1.2456644
           col7       col8      col9      col10       col11     col12     col13
row1 -0.8281112 -0.1835130 -1.951884 -1.1613650 -0.05746576 -1.362813 0.6964863
row5 -0.8507711 -0.8990512  1.409644  0.9241209  0.52586866 -1.097044 0.8965914
          col14      col15      col16       col17     col18      col19
row1 -1.0897341 -0.2226396 -0.5109971  0.01719182 0.3744059 -0.7647721
row5  0.5902024 -0.6807754  1.5094170 -0.18523603 1.5770959 -1.9888246
          col20
row1  0.9640789
row5 -0.6560793
> tmp[,c("col6","col20")]
            col6      col20
row1 -0.77220513  0.9640789
row2 -0.73427552  0.7136051
row3  0.23847518 -0.6897946
row4 -0.03110975 -1.1413533
row5  1.24566442 -0.6560793
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -0.7722051  0.9640789
row5  1.2456644 -0.6560793
> 
> 
> 
> 
> 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.83443 50.84668 48.8535 51.73259 50.35226 105.2592 51.14183 49.58497
         col9    col10    col11    col12    col13    col14    col15    col16
row1 51.41955 50.24021 51.09124 51.05989 49.27671 51.60752 49.18432 50.18895
        col17    col18    col19    col20
row1 49.08347 48.86498 50.06024 105.0475
> tmp[,"col10"]
        col10
row1 50.24021
row2 29.15360
row3 30.90976
row4 29.01408
row5 49.98991
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 48.83443 50.84668 48.85350 51.73259 50.35226 105.2592 51.14183 49.58497
row5 50.74489 49.34760 48.39869 51.63408 49.33060 105.2531 50.40460 53.18475
         col9    col10    col11    col12    col13    col14    col15    col16
row1 51.41955 50.24021 51.09124 51.05989 49.27671 51.60752 49.18432 50.18895
row5 48.77157 49.98991 49.44517 49.43136 48.72204 51.47875 50.07202 51.07654
        col17    col18    col19    col20
row1 49.08347 48.86498 50.06024 105.0475
row5 49.70117 50.46070 49.43199 104.9196
> tmp[,c("col6","col20")]
          col6     col20
row1 105.25917 105.04752
row2  75.36002  74.17587
row3  74.47147  75.15099
row4  75.63176  74.88124
row5 105.25306 104.91965
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.2592 105.0475
row5 105.2531 104.9196
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.2592 105.0475
row5 105.2531 104.9196
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  0.57710047
[2,] -0.62807933
[3,] -0.42052723
[4,] -0.07586091
[5,]  0.97783283
> tmp[,c("col17","col7")]
         col17       col7
[1,] 0.3440905  0.1507872
[2,] 0.6097798  1.7254306
[3,] 0.8566952 -0.8374531
[4,] 0.9987188  0.7873156
[5,] 2.6865128  1.6703340
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,] -0.37356207  1.2787732
[2,] -0.97540254  1.0530783
[3,]  0.05620648  1.1081145
[4,] -1.02710404 -2.1321324
[5,] -0.59697836 -0.4684145
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.3735621
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.3735621
[2,] -0.9754025
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]       [,3]       [,4]       [,5]      [,6]     [,7]
row3  0.1461547 -0.2662398 -0.1971678  0.6631017 -0.5930124 -1.095463 0.163630
row1 -0.8596146 -0.1972343  0.1187174 -0.4513800 -1.9485393  1.164407 1.397359
           [,8]       [,9]     [,10]    [,11]      [,12]     [,13]      [,14]
row3 -0.7947848 -0.6559411 0.2084335 1.345568 -2.7287854 0.5092514  0.1162121
row1  0.3256624  1.5323472 0.6846484 1.250097 -0.1038882 0.5141828 -0.9395643
         [,15]      [,16]      [,17]     [,18]      [,19]     [,20]
row3  1.772394 -0.6033953  1.8278323 0.6281181 0.50768454 1.0239886
row1 -1.129109  0.4780548 -0.7641641 0.6077814 0.04061933 0.2827904
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]       [,2]     [,3]      [,4]     [,5]     [,6]        [,7]
row2 1.294325 -0.2722386 -1.16741 -1.034545 1.491337 0.542484 -0.07362183
           [,8]      [,9]      [,10]
row2 -0.9212043 -1.176354 -0.9953127
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]       [,2]   [,3]     [,4]        [,5]      [,6]      [,7]
row5 -0.5472971 -0.3524707 1.2436 -1.40298 0.001631353 -0.544859 0.1765196
          [,8]      [,9]     [,10]      [,11]     [,12]     [,13]      [,14]
row5 0.7907055 0.5547693 -1.151907 -0.1984964 0.4763079 -1.616897 -0.8564082
        [,15]    [,16]      [,17]      [,18]      [,19]     [,20]
row5 1.489848 1.103378 0.06491709 -0.9133695 -0.8707255 0.7692521
> 
> 
> 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: 0x631a4245d9d0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3b978e3245466f"
 [2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3b978e6dbe02fc"
 [3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3b978e499e83c7"
 [4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3b978e4327dba8"
 [5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3b978e23396c95"
 [6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3b978e31eb7db9"
 [7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3b978e608c90"  
 [8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3b978e4263b397"
 [9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3b978e2f2f756a"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3b978e1be9f296"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3b978e6817b4b5"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3b978e1b31c37" 
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3b978e660a69b5"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3b978ee97dd8e" 
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3b978eab521ab" 
> 
> 
> ### 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: 0x631a416e8250>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x631a416e8250>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x631a416e8250>
> rowMedians(tmp)
  [1]  0.0880925800  0.1408683999 -0.1729224327  0.2426453874 -0.0498574172
  [6]  0.0744299553 -0.5260364990  0.0708762956  0.3197488654  0.2255011806
 [11]  0.2058267431 -0.2572438528 -0.2300432166  0.1362295099 -0.6227403277
 [16]  0.3681441594 -0.0850958670  0.1702350478  0.4177895045  0.2855397436
 [21] -0.4377456164  0.2601655911 -0.1120434152  0.0956543079 -0.1553636243
 [26]  0.0098596114 -0.1447372238  0.1555402594  0.6526872289  0.3463221100
 [31]  0.3135127232 -0.0472248550  0.2835716125  0.6334162010 -0.3130918063
 [36] -0.6176600395 -0.2889775250  0.2715156845  0.0363660153  0.0203656114
 [41] -0.3270569771  0.1887637495 -0.2893272814  0.0711239409  0.2406838143
 [46] -0.2912544913 -0.2406011169 -0.0237732581  0.2957430562  0.1256065380
 [51] -0.3308873116  0.1701675067  0.0585313051 -0.4101606396 -0.4321038897
 [56] -0.4550534796  0.2149434079 -0.5887615989 -0.5524037350  0.3168939124
 [61]  0.3710727521  0.2224316613  0.1116980983 -0.3926672294 -0.3955307792
 [66] -0.1446845500  0.5776480827  0.0074707435 -0.5317019579  0.4763128253
 [71] -0.3175157895 -0.1213565640  0.3255103037  0.0724611555 -0.7491238117
 [76]  0.1426320140 -0.0722352396  0.2236130649 -0.2315065164  0.1676083021
 [81] -0.2426731334 -0.0177869545  0.2658624423  0.0829871862 -0.0396862379
 [86] -0.2801162910  0.0607714390  0.3325646737 -0.3685951054  0.3209825044
 [91] -0.1514529182 -0.1532360708 -0.0124817575  0.4547204290 -0.0988040480
 [96]  0.3009777102 -0.0134020136 -0.0016249881 -0.4120285841 -0.2783162494
[101] -0.5662500018 -0.5709876368  0.3306817571 -0.4381502649  0.4522338802
[106]  0.4854053503  0.6863066800 -0.1637981887  0.1210132806 -0.3680941772
[111] -0.4835065205 -0.2536922297 -0.0307862514 -0.2888750308  0.4342944519
[116] -0.1250691044  0.0535858505 -0.1771688854  0.2033267383 -0.2783756162
[121] -0.0856597254  0.2188942531  0.1677740573 -0.5641427713  0.0683594772
[126]  0.0009066806  0.0225354841 -0.0901766050 -0.0103036377 -0.1164930404
[131]  0.2017457323  0.1611180665  0.3634830675 -0.0590593913  0.3760554885
[136]  0.3694638229  0.5418579083 -0.1522775074 -0.0214999093  0.1094297763
[141]  0.4098320362 -0.5103777652 -0.2698643419  0.2345451277 -0.2580775335
[146]  0.2992113072  0.5634785269 -0.1775922391  0.1094162026 -0.0500214652
[151] -0.0498752103 -0.5282463563  0.2178302621 -0.4488469643  0.1697738011
[156] -0.0396557216  0.2727209242  0.1999554805  0.0900733317 -0.3989286110
[161] -0.1397354417 -0.6147946287  0.3277063461  0.0915274790 -0.2256229965
[166] -0.4772401662  0.3210819585 -0.3183635828 -0.2212616444  0.0241654486
[171] -0.2136987367 -0.0423773813  0.3680717430  0.2105975377  0.3276376867
[176]  0.1174300884 -0.1468609303 -0.0805348649 -0.1798331727  0.4863262481
[181]  0.5264742216 -0.1577553187 -0.7426481502  0.1862512679 -0.3036240723
[186]  0.2812496167  0.4549338243  0.1148962691  0.7440739539  0.1762962282
[191]  0.3351088809 -0.2700182730 -0.7102044183 -0.1140968476  0.1234874268
[196]  0.4978873070  0.3397133751  0.0940923111  0.2879882241 -0.3558427272
[201] -0.1556443816 -0.0364468341 -0.0407251752 -0.0503589650  0.0608240657
[206]  0.1260108551  0.0505974550 -0.3037289339 -0.0744816139 -0.1304307314
[211]  0.0187239226  0.2153133377  0.3199456535  0.2604860242  0.1314438603
[216] -0.0072229953 -0.0104378993  0.2808160038  0.1174084692  0.0708957464
[221]  0.3904217877 -0.0290367745 -0.5486801228 -0.5803139319  0.5376558005
[226]  0.5473331222  0.2750685782 -0.0173711532 -0.4791922065  0.1136084486
> 
> proc.time()
   user  system elapsed 
  1.301   1.513   2.803 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x616d278b0c10>
> .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: 0x616d278b0c10>
> .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: 0x616d278b0c10>
> .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: 0x616d278b0c10>
> 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: 0x616d285732d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x616d285732d0>
> .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: 0x616d285732d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x616d285732d0>
> .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: 0x616d285732d0>
> 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: 0x616d28c48d70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x616d28c48d70>
> .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: 0x616d28c48d70>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x616d28c48d70>
> .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: 0x616d28c48d70>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x616d28c48d70>
> .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: 0x616d28c48d70>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x616d28c48d70>
> .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: 0x616d28c48d70>
> 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: 0x616d287bc370>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x616d287bc370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x616d287bc370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x616d287bc370>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3b992f343561be" "BufferedMatrixFile3b992f6c50f0ec"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3b992f343561be" "BufferedMatrixFile3b992f6c50f0ec"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x616d28707ff0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x616d28707ff0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x616d28707ff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x616d28707ff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x616d28707ff0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x616d28707ff0>
> .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: 0x616d288ea3d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x616d288ea3d0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x616d288ea3d0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x616d288ea3d0>
> 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: 0x616d2a09bfb0>
> .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: 0x616d2a09bfb0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.245   0.055   0.286 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.255   0.045   0.288 

Example timings