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

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

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.4 LTS)x86_644.6.0 alpha (2026-04-05 r89794) 4917
kjohnson3macOS 13.7.7 Venturaarm64R Under development (unstable) (2026-03-26 r89717) -- "Unsuffered Consequences" 4629
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

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


CHECK results for BufferedMatrix on nebbiolo1

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

raw results


Summary

Package: BufferedMatrix
Version: 1.75.0
Command: /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz
StartedAt: 2026-04-09 21:55:42 -0400 (Thu, 09 Apr 2026)
EndedAt: 2026-04-09 21:56:07 -0400 (Thu, 09 Apr 2026)
EllapsedTime: 25.1 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.6.0 alpha (2026-04-05 r89794)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
    gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
    GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
* running under: Ubuntu 24.04.4 LTS
* using session charset: UTF-8
* current time: 2026-04-10 01:55:42 UTC
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... OK
* used C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ...* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘Rcodetesting.R’
  Running ‘c_code_level_tests.R’
  Running ‘objectTesting.R’
  Running ‘rawCalltesting.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.6.0 alpha (2026-04-05 r89794)
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.246   0.053   0.286 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.6.0 alpha (2026-04-05 r89794)
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 480193 25.7    1053195 56.3   637568 34.1
Vcells 887233  6.8    8388608 64.0  2083868 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Apr  9 21:55:57 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Apr  9 21:55:57 2026"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x57ce3b10da60>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Apr  9 21:55:57 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Apr  9 21:55:58 2026"
> 
> ColMode(tmp2)
<pointer: 0x57ce3b10da60>
> 
> 
> 
> ### 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.9419181  2.4325390  0.09109277  1.4828084
[2,]  0.0481916 -0.3636536  0.72747266  0.4674364
[3,] -0.8554136  0.3338959  0.42934687 -1.6556900
[4,]  0.5825839  0.3186993 -1.00952043  2.2437656
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]       [,3]      [,4]
[1,] 99.9419181 2.4325390 0.09109277 1.4828084
[2,]  0.0481916 0.3636536 0.72747266 0.4674364
[3,]  0.8554136 0.3338959 0.42934687 1.6556900
[4,]  0.5825839 0.3186993 1.00952043 2.2437656
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9970955 1.5596599 0.3018158 1.2177062
[2,] 0.2195258 0.6030370 0.8529201 0.6836932
[3,] 0.9248857 0.5778373 0.6552457 1.2867362
[4,] 0.7632719 0.5645346 1.0047489 1.4979204
> 
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.91287 43.02914 28.10925 38.65987
[2,]  27.24345 31.39402 34.25667 32.30437
[3,]  35.10427 31.11227 31.98180 39.52305
[4,]  33.21530 30.96405 36.05701 42.22297
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x57ce3bddb5c0>
> exp(tmp5)
<pointer: 0x57ce3bddb5c0>
> log(tmp5,2)
<pointer: 0x57ce3bddb5c0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.1267
> Min(tmp5)
[1] 52.44473
> mean(tmp5)
[1] 73.41619
> Sum(tmp5)
[1] 14683.24
> Var(tmp5)
[1] 856.9326
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 92.09664 70.29717 69.69968 70.96796 72.84055 73.28521 68.72643 71.42478
 [9] 69.29810 75.52536
> rowSums(tmp5)
 [1] 1841.933 1405.943 1393.994 1419.359 1456.811 1465.704 1374.529 1428.496
 [9] 1385.962 1510.507
> rowVars(tmp5)
 [1] 7914.36361   56.51005   59.23125   63.17264   56.16279   88.64562
 [7]   87.53542   71.42271   41.28599   88.26994
> rowSd(tmp5)
 [1] 88.962709  7.517317  7.696184  7.948122  7.494184  9.415180  9.356037
 [8]  8.451196  6.425418  9.395209
> rowMax(tmp5)
 [1] 468.12668  88.60922  83.03729  87.88158  85.61065  93.12533  89.73733
 [8]  90.27648  78.87286  91.28538
> rowMin(tmp5)
 [1] 54.94909 56.70367 54.05117 58.53636 54.42203 58.93208 52.44473 56.96414
 [9] 57.09531 62.46317
> 
> colMeans(tmp5)
 [1] 115.47494  74.39909  71.20017  76.23417  70.55248  66.98319  75.67446
 [8]  66.43992  71.47403  72.41938  68.34423  74.87182  69.55750  73.40657
[15]  70.94907  68.73967  70.79030  71.69066  72.95899  66.16314
> colSums(tmp5)
 [1] 1154.7494  743.9909  712.0017  762.3417  705.5248  669.8319  756.7446
 [8]  664.3992  714.7403  724.1938  683.4423  748.7182  695.5750  734.0657
[15]  709.4907  687.3967  707.9030  716.9066  729.5899  661.6314
> colVars(tmp5)
 [1] 15467.83165    88.80788    65.35594   153.31353    47.51889    51.12948
 [7]    49.42106    30.06052    29.51636   104.10394    75.87684    35.13501
[13]    47.74258    86.22504    69.25863    30.00336    46.45825    57.95133
[19]    92.12153    70.72986
> colSd(tmp5)
 [1] 124.369738   9.423793   8.084302  12.381984   6.893394   7.150488
 [7]   7.030011   5.482748   5.432896  10.203134   8.710731   5.927479
[13]   6.909601   9.285744   8.322177   5.477532   6.816029   7.612577
[19]   9.597996   8.410104
> colMax(tmp5)
 [1] 468.12668  89.55951  85.78456  93.12533  81.75857  79.79246  88.60922
 [8]  74.36375  82.29738  91.28538  77.63518  83.03729  81.22413  83.75080
[15]  85.37051  77.22975  81.55997  82.58600  87.92741  84.59847
> colMin(tmp5)
 [1] 56.70367 64.44760 58.50572 52.44473 60.46702 56.96414 66.74222 57.09531
 [9] 63.58854 58.93208 54.05117 60.84918 61.81730 54.42203 57.75969 62.46317
[17] 58.30841 58.53636 61.49748 54.94909
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1]       NA 70.29717 69.69968 70.96796 72.84055 73.28521 68.72643 71.42478
 [9] 69.29810 75.52536
> rowSums(tmp5)
 [1]       NA 1405.943 1393.994 1419.359 1456.811 1465.704 1374.529 1428.496
 [9] 1385.962 1510.507
> rowVars(tmp5)
 [1] 8346.13910   56.51005   59.23125   63.17264   56.16279   88.64562
 [7]   87.53542   71.42271   41.28599   88.26994
> rowSd(tmp5)
 [1] 91.357206  7.517317  7.696184  7.948122  7.494184  9.415180  9.356037
 [8]  8.451196  6.425418  9.395209
> rowMax(tmp5)
 [1]       NA 88.60922 83.03729 87.88158 85.61065 93.12533 89.73733 90.27648
 [9] 78.87286 91.28538
> rowMin(tmp5)
 [1]       NA 56.70367 54.05117 58.53636 54.42203 58.93208 52.44473 56.96414
 [9] 57.09531 62.46317
> 
> colMeans(tmp5)
 [1] 115.47494  74.39909  71.20017        NA  70.55248  66.98319  75.67446
 [8]  66.43992  71.47403  72.41938  68.34423  74.87182  69.55750  73.40657
[15]  70.94907  68.73967  70.79030  71.69066  72.95899  66.16314
> colSums(tmp5)
 [1] 1154.7494  743.9909  712.0017        NA  705.5248  669.8319  756.7446
 [8]  664.3992  714.7403  724.1938  683.4423  748.7182  695.5750  734.0657
[15]  709.4907  687.3967  707.9030  716.9066  729.5899  661.6314
> colVars(tmp5)
 [1] 15467.83165    88.80788    65.35594          NA    47.51889    51.12948
 [7]    49.42106    30.06052    29.51636   104.10394    75.87684    35.13501
[13]    47.74258    86.22504    69.25863    30.00336    46.45825    57.95133
[19]    92.12153    70.72986
> colSd(tmp5)
 [1] 124.369738   9.423793   8.084302         NA   6.893394   7.150488
 [7]   7.030011   5.482748   5.432896  10.203134   8.710731   5.927479
[13]   6.909601   9.285744   8.322177   5.477532   6.816029   7.612577
[19]   9.597996   8.410104
> colMax(tmp5)
 [1] 468.12668  89.55951  85.78456        NA  81.75857  79.79246  88.60922
 [8]  74.36375  82.29738  91.28538  77.63518  83.03729  81.22413  83.75080
[15]  85.37051  77.22975  81.55997  82.58600  87.92741  84.59847
> colMin(tmp5)
 [1] 56.70367 64.44760 58.50572       NA 60.46702 56.96414 66.74222 57.09531
 [9] 63.58854 58.93208 54.05117 60.84918 61.81730 54.42203 57.75969 62.46317
[17] 58.30841 58.53636 61.49748 54.94909
> 
> Max(tmp5,na.rm=TRUE)
[1] 468.1267
> Min(tmp5,na.rm=TRUE)
[1] 52.44473
> mean(tmp5,na.rm=TRUE)
[1] 73.38076
> Sum(tmp5,na.rm=TRUE)
[1] 14602.77
> Var(tmp5,na.rm=TRUE)
[1] 861.0083
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.70881 70.29717 69.69968 70.96796 72.84055 73.28521 68.72643 71.42478
 [9] 69.29810 75.52536
> rowSums(tmp5,na.rm=TRUE)
 [1] 1761.467 1405.943 1393.994 1419.359 1456.811 1465.704 1374.529 1428.496
 [9] 1385.962 1510.507
> rowVars(tmp5,na.rm=TRUE)
 [1] 8346.13910   56.51005   59.23125   63.17264   56.16279   88.64562
 [7]   87.53542   71.42271   41.28599   88.26994
> rowSd(tmp5,na.rm=TRUE)
 [1] 91.357206  7.517317  7.696184  7.948122  7.494184  9.415180  9.356037
 [8]  8.451196  6.425418  9.395209
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.12668  88.60922  83.03729  87.88158  85.61065  93.12533  89.73733
 [8]  90.27648  78.87286  91.28538
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.94909 56.70367 54.05117 58.53636 54.42203 58.93208 52.44473 56.96414
 [9] 57.09531 62.46317
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 115.47494  74.39909  71.20017  75.76402  70.55248  66.98319  75.67446
 [8]  66.43992  71.47403  72.41938  68.34423  74.87182  69.55750  73.40657
[15]  70.94907  68.73967  70.79030  71.69066  72.95899  66.16314
> colSums(tmp5,na.rm=TRUE)
 [1] 1154.7494  743.9909  712.0017  681.8762  705.5248  669.8319  756.7446
 [8]  664.3992  714.7403  724.1938  683.4423  748.7182  695.5750  734.0657
[15]  709.4907  687.3967  707.9030  716.9066  729.5899  661.6314
> colVars(tmp5,na.rm=TRUE)
 [1] 15467.83165    88.80788    65.35594   169.99108    47.51889    51.12948
 [7]    49.42106    30.06052    29.51636   104.10394    75.87684    35.13501
[13]    47.74258    86.22504    69.25863    30.00336    46.45825    57.95133
[19]    92.12153    70.72986
> colSd(tmp5,na.rm=TRUE)
 [1] 124.369738   9.423793   8.084302  13.038063   6.893394   7.150488
 [7]   7.030011   5.482748   5.432896  10.203134   8.710731   5.927479
[13]   6.909601   9.285744   8.322177   5.477532   6.816029   7.612577
[19]   9.597996   8.410104
> colMax(tmp5,na.rm=TRUE)
 [1] 468.12668  89.55951  85.78456  93.12533  81.75857  79.79246  88.60922
 [8]  74.36375  82.29738  91.28538  77.63518  83.03729  81.22413  83.75080
[15]  85.37051  77.22975  81.55997  82.58600  87.92741  84.59847
> colMin(tmp5,na.rm=TRUE)
 [1] 56.70367 64.44760 58.50572 52.44473 60.46702 56.96414 66.74222 57.09531
 [9] 63.58854 58.93208 54.05117 60.84918 61.81730 54.42203 57.75969 62.46317
[17] 58.30841 58.53636 61.49748 54.94909
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1]      NaN 70.29717 69.69968 70.96796 72.84055 73.28521 68.72643 71.42478
 [9] 69.29810 75.52536
> rowSums(tmp5,na.rm=TRUE)
 [1]    0.000 1405.943 1393.994 1419.359 1456.811 1465.704 1374.529 1428.496
 [9] 1385.962 1510.507
> rowVars(tmp5,na.rm=TRUE)
 [1]       NA 56.51005 59.23125 63.17264 56.16279 88.64562 87.53542 71.42271
 [9] 41.28599 88.26994
> rowSd(tmp5,na.rm=TRUE)
 [1]       NA 7.517317 7.696184 7.948122 7.494184 9.415180 9.356037 8.451196
 [9] 6.425418 9.395209
> rowMax(tmp5,na.rm=TRUE)
 [1]       NA 88.60922 83.03729 87.88158 85.61065 93.12533 89.73733 90.27648
 [9] 78.87286 91.28538
> rowMin(tmp5,na.rm=TRUE)
 [1]       NA 56.70367 54.05117 58.53636 54.42203 58.93208 52.44473 56.96414
 [9] 57.09531 62.46317
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 76.29141 72.71460 72.61067      NaN 70.49078 67.22816 76.08511 65.82647
 [9] 71.51401 71.27647 68.88989 74.92585 68.26121 72.25721 71.64939 68.56725
[17] 71.24771 71.94612 71.85616 67.40914
> colSums(tmp5,na.rm=TRUE)
 [1] 686.6227 654.4314 653.4960   0.0000 634.4170 605.0534 684.7660 592.4382
 [9] 643.6261 641.4883 620.0090 674.3327 614.3509 650.3149 644.8445 617.1052
[17] 641.2294 647.5151 646.7054 606.6823
> colVars(tmp5,na.rm=TRUE)
 [1] 128.63730  67.98687  51.14362        NA  53.41592  56.84555  53.70155
 [8]  29.58453  33.18792 102.42186  82.01176  39.49404  34.80622  82.14162
[15]  72.39838  33.41935  49.91175  64.46109  89.95401  62.10514
> colSd(tmp5,na.rm=TRUE)
 [1] 11.341838  8.245415  7.151477        NA  7.308620  7.539599  7.328134
 [8]  5.439166  5.760895 10.120368  9.056035  6.284428  5.899679  9.063201
[15]  8.508724  5.780947  7.064825  8.028766  9.484409  7.880682
> colMax(tmp5,na.rm=TRUE)
 [1] 90.27648 89.18922 85.78456     -Inf 81.75857 79.79246 88.60922 74.36375
 [9] 82.29738 91.28538 77.63518 83.03729 80.77704 83.26652 85.37051 77.22975
[17] 81.55997 82.58600 87.92741 84.59847
> colMin(tmp5,na.rm=TRUE)
 [1] 56.70367 64.44760 59.59056      Inf 60.46702 56.96414 66.74222 57.09531
 [9] 63.58854 58.93208 54.05117 60.84918 61.81730 54.42203 57.75969 62.46317
[17] 58.30841 58.53636 61.49748 57.22501
> 
> 
> 
> 
> 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] 123.4564 134.5410 157.1721 203.5996 157.2288 133.4455 243.8591 154.6852
 [9] 292.6357 244.6089
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 123.4564 134.5410 157.1721 203.5996 157.2288 133.4455 243.8591 154.6852
 [9] 292.6357 244.6089
> 
> 
> 
> 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] -8.526513e-14 -5.684342e-14  0.000000e+00  2.842171e-14  1.136868e-13
 [6]  1.705303e-13  0.000000e+00  1.136868e-13  7.105427e-14  1.705303e-13
[11] -1.705303e-13 -1.421085e-13 -4.263256e-14  1.136868e-13  1.421085e-14
[16]  5.684342e-14 -8.526513e-14  5.684342e-14  1.136868e-13 -8.526513e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
6   7 
2   13 
6   16 
3   20 
7   10 
4   9 
5   7 
3   11 
5   18 
2   4 
6   6 
8   4 
1   11 
5   13 
2   6 
4   15 
4   19 
9   17 
7   6 
1   4 
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.22795
> Min(tmp)
[1] -2.014418
> mean(tmp)
[1] 0.06911618
> Sum(tmp)
[1] 6.911618
> Var(tmp)
[1] 1.125911
> 
> rowMeans(tmp)
[1] 0.06911618
> rowSums(tmp)
[1] 6.911618
> rowVars(tmp)
[1] 1.125911
> rowSd(tmp)
[1] 1.06109
> rowMax(tmp)
[1] 2.22795
> rowMin(tmp)
[1] -2.014418
> 
> colMeans(tmp)
  [1]  0.417844637  0.074698595 -0.933149977 -0.801607635 -0.607015503
  [6] -0.661367900 -1.180710831 -0.024357359 -0.515934175 -0.977619336
 [11]  0.769292809  1.025490493  1.632081044  0.152875940  1.009531778
 [16] -0.704584748 -1.047190524  1.624723302 -0.129081515  0.437302558
 [21] -0.925644984 -0.234719645  1.325502742 -0.639579109 -0.210954310
 [26]  0.325175171  1.204222657 -0.252228938 -1.879950903 -1.095060036
 [31] -1.942565645  2.007135061  0.127806463  0.175983791  1.019714163
 [36]  0.816227808  2.018132322  0.588692523 -1.964819998 -0.743325634
 [41] -1.474648902  0.355845981  1.957158504 -0.285036492  1.107364107
 [46]  1.933954408 -1.143860009  0.540375283 -0.818242935  0.280306207
 [51] -0.401005866  0.005360064  2.141579859  1.047322208 -0.364678376
 [56]  0.822179366 -0.337840428 -1.189727478 -0.019813636  1.273751074
 [61]  2.227950356  0.736046793 -2.014131359 -1.423685608 -0.681879450
 [66]  0.913876312  0.147592168  0.452915167 -0.658436035 -0.662689517
 [71]  1.192537288  0.994914975  0.303932149 -0.554460200 -2.014418151
 [76] -0.697809737  0.310777734  0.631781738 -0.854388212 -1.625471785
 [81]  0.038085152  1.850767353 -0.056687997  2.198613126 -0.826511194
 [86]  0.941595534  0.993239534  0.083478485  1.143451981  1.051329380
 [91] -1.220787870 -0.845222128  1.554207565  0.384289633  0.144621347
 [96] -0.254072928 -0.001792306 -1.293255324  0.418188330 -0.828182256
> colSums(tmp)
  [1]  0.417844637  0.074698595 -0.933149977 -0.801607635 -0.607015503
  [6] -0.661367900 -1.180710831 -0.024357359 -0.515934175 -0.977619336
 [11]  0.769292809  1.025490493  1.632081044  0.152875940  1.009531778
 [16] -0.704584748 -1.047190524  1.624723302 -0.129081515  0.437302558
 [21] -0.925644984 -0.234719645  1.325502742 -0.639579109 -0.210954310
 [26]  0.325175171  1.204222657 -0.252228938 -1.879950903 -1.095060036
 [31] -1.942565645  2.007135061  0.127806463  0.175983791  1.019714163
 [36]  0.816227808  2.018132322  0.588692523 -1.964819998 -0.743325634
 [41] -1.474648902  0.355845981  1.957158504 -0.285036492  1.107364107
 [46]  1.933954408 -1.143860009  0.540375283 -0.818242935  0.280306207
 [51] -0.401005866  0.005360064  2.141579859  1.047322208 -0.364678376
 [56]  0.822179366 -0.337840428 -1.189727478 -0.019813636  1.273751074
 [61]  2.227950356  0.736046793 -2.014131359 -1.423685608 -0.681879450
 [66]  0.913876312  0.147592168  0.452915167 -0.658436035 -0.662689517
 [71]  1.192537288  0.994914975  0.303932149 -0.554460200 -2.014418151
 [76] -0.697809737  0.310777734  0.631781738 -0.854388212 -1.625471785
 [81]  0.038085152  1.850767353 -0.056687997  2.198613126 -0.826511194
 [86]  0.941595534  0.993239534  0.083478485  1.143451981  1.051329380
 [91] -1.220787870 -0.845222128  1.554207565  0.384289633  0.144621347
 [96] -0.254072928 -0.001792306 -1.293255324  0.418188330 -0.828182256
> 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.417844637  0.074698595 -0.933149977 -0.801607635 -0.607015503
  [6] -0.661367900 -1.180710831 -0.024357359 -0.515934175 -0.977619336
 [11]  0.769292809  1.025490493  1.632081044  0.152875940  1.009531778
 [16] -0.704584748 -1.047190524  1.624723302 -0.129081515  0.437302558
 [21] -0.925644984 -0.234719645  1.325502742 -0.639579109 -0.210954310
 [26]  0.325175171  1.204222657 -0.252228938 -1.879950903 -1.095060036
 [31] -1.942565645  2.007135061  0.127806463  0.175983791  1.019714163
 [36]  0.816227808  2.018132322  0.588692523 -1.964819998 -0.743325634
 [41] -1.474648902  0.355845981  1.957158504 -0.285036492  1.107364107
 [46]  1.933954408 -1.143860009  0.540375283 -0.818242935  0.280306207
 [51] -0.401005866  0.005360064  2.141579859  1.047322208 -0.364678376
 [56]  0.822179366 -0.337840428 -1.189727478 -0.019813636  1.273751074
 [61]  2.227950356  0.736046793 -2.014131359 -1.423685608 -0.681879450
 [66]  0.913876312  0.147592168  0.452915167 -0.658436035 -0.662689517
 [71]  1.192537288  0.994914975  0.303932149 -0.554460200 -2.014418151
 [76] -0.697809737  0.310777734  0.631781738 -0.854388212 -1.625471785
 [81]  0.038085152  1.850767353 -0.056687997  2.198613126 -0.826511194
 [86]  0.941595534  0.993239534  0.083478485  1.143451981  1.051329380
 [91] -1.220787870 -0.845222128  1.554207565  0.384289633  0.144621347
 [96] -0.254072928 -0.001792306 -1.293255324  0.418188330 -0.828182256
> colMin(tmp)
  [1]  0.417844637  0.074698595 -0.933149977 -0.801607635 -0.607015503
  [6] -0.661367900 -1.180710831 -0.024357359 -0.515934175 -0.977619336
 [11]  0.769292809  1.025490493  1.632081044  0.152875940  1.009531778
 [16] -0.704584748 -1.047190524  1.624723302 -0.129081515  0.437302558
 [21] -0.925644984 -0.234719645  1.325502742 -0.639579109 -0.210954310
 [26]  0.325175171  1.204222657 -0.252228938 -1.879950903 -1.095060036
 [31] -1.942565645  2.007135061  0.127806463  0.175983791  1.019714163
 [36]  0.816227808  2.018132322  0.588692523 -1.964819998 -0.743325634
 [41] -1.474648902  0.355845981  1.957158504 -0.285036492  1.107364107
 [46]  1.933954408 -1.143860009  0.540375283 -0.818242935  0.280306207
 [51] -0.401005866  0.005360064  2.141579859  1.047322208 -0.364678376
 [56]  0.822179366 -0.337840428 -1.189727478 -0.019813636  1.273751074
 [61]  2.227950356  0.736046793 -2.014131359 -1.423685608 -0.681879450
 [66]  0.913876312  0.147592168  0.452915167 -0.658436035 -0.662689517
 [71]  1.192537288  0.994914975  0.303932149 -0.554460200 -2.014418151
 [76] -0.697809737  0.310777734  0.631781738 -0.854388212 -1.625471785
 [81]  0.038085152  1.850767353 -0.056687997  2.198613126 -0.826511194
 [86]  0.941595534  0.993239534  0.083478485  1.143451981  1.051329380
 [91] -1.220787870 -0.845222128  1.554207565  0.384289633  0.144621347
 [96] -0.254072928 -0.001792306 -1.293255324  0.418188330 -0.828182256
> colMedians(tmp)
  [1]  0.417844637  0.074698595 -0.933149977 -0.801607635 -0.607015503
  [6] -0.661367900 -1.180710831 -0.024357359 -0.515934175 -0.977619336
 [11]  0.769292809  1.025490493  1.632081044  0.152875940  1.009531778
 [16] -0.704584748 -1.047190524  1.624723302 -0.129081515  0.437302558
 [21] -0.925644984 -0.234719645  1.325502742 -0.639579109 -0.210954310
 [26]  0.325175171  1.204222657 -0.252228938 -1.879950903 -1.095060036
 [31] -1.942565645  2.007135061  0.127806463  0.175983791  1.019714163
 [36]  0.816227808  2.018132322  0.588692523 -1.964819998 -0.743325634
 [41] -1.474648902  0.355845981  1.957158504 -0.285036492  1.107364107
 [46]  1.933954408 -1.143860009  0.540375283 -0.818242935  0.280306207
 [51] -0.401005866  0.005360064  2.141579859  1.047322208 -0.364678376
 [56]  0.822179366 -0.337840428 -1.189727478 -0.019813636  1.273751074
 [61]  2.227950356  0.736046793 -2.014131359 -1.423685608 -0.681879450
 [66]  0.913876312  0.147592168  0.452915167 -0.658436035 -0.662689517
 [71]  1.192537288  0.994914975  0.303932149 -0.554460200 -2.014418151
 [76] -0.697809737  0.310777734  0.631781738 -0.854388212 -1.625471785
 [81]  0.038085152  1.850767353 -0.056687997  2.198613126 -0.826511194
 [86]  0.941595534  0.993239534  0.083478485  1.143451981  1.051329380
 [91] -1.220787870 -0.845222128  1.554207565  0.384289633  0.144621347
 [96] -0.254072928 -0.001792306 -1.293255324  0.418188330 -0.828182256
> colRanges(tmp)
          [,1]       [,2]     [,3]       [,4]       [,5]       [,6]      [,7]
[1,] 0.4178446 0.07469859 -0.93315 -0.8016076 -0.6070155 -0.6613679 -1.180711
[2,] 0.4178446 0.07469859 -0.93315 -0.8016076 -0.6070155 -0.6613679 -1.180711
            [,8]       [,9]      [,10]     [,11]   [,12]    [,13]     [,14]
[1,] -0.02435736 -0.5159342 -0.9776193 0.7692928 1.02549 1.632081 0.1528759
[2,] -0.02435736 -0.5159342 -0.9776193 0.7692928 1.02549 1.632081 0.1528759
        [,15]      [,16]     [,17]    [,18]      [,19]     [,20]     [,21]
[1,] 1.009532 -0.7045847 -1.047191 1.624723 -0.1290815 0.4373026 -0.925645
[2,] 1.009532 -0.7045847 -1.047191 1.624723 -0.1290815 0.4373026 -0.925645
          [,22]    [,23]      [,24]      [,25]     [,26]    [,27]      [,28]
[1,] -0.2347196 1.325503 -0.6395791 -0.2109543 0.3251752 1.204223 -0.2522289
[2,] -0.2347196 1.325503 -0.6395791 -0.2109543 0.3251752 1.204223 -0.2522289
         [,29]    [,30]     [,31]    [,32]     [,33]     [,34]    [,35]
[1,] -1.879951 -1.09506 -1.942566 2.007135 0.1278065 0.1759838 1.019714
[2,] -1.879951 -1.09506 -1.942566 2.007135 0.1278065 0.1759838 1.019714
         [,36]    [,37]     [,38]    [,39]      [,40]     [,41]    [,42]
[1,] 0.8162278 2.018132 0.5886925 -1.96482 -0.7433256 -1.474649 0.355846
[2,] 0.8162278 2.018132 0.5886925 -1.96482 -0.7433256 -1.474649 0.355846
        [,43]      [,44]    [,45]    [,46]    [,47]     [,48]      [,49]
[1,] 1.957159 -0.2850365 1.107364 1.933954 -1.14386 0.5403753 -0.8182429
[2,] 1.957159 -0.2850365 1.107364 1.933954 -1.14386 0.5403753 -0.8182429
         [,50]      [,51]       [,52]   [,53]    [,54]      [,55]     [,56]
[1,] 0.2803062 -0.4010059 0.005360064 2.14158 1.047322 -0.3646784 0.8221794
[2,] 0.2803062 -0.4010059 0.005360064 2.14158 1.047322 -0.3646784 0.8221794
          [,57]     [,58]       [,59]    [,60]   [,61]     [,62]     [,63]
[1,] -0.3378404 -1.189727 -0.01981364 1.273751 2.22795 0.7360468 -2.014131
[2,] -0.3378404 -1.189727 -0.01981364 1.273751 2.22795 0.7360468 -2.014131
         [,64]      [,65]     [,66]     [,67]     [,68]     [,69]      [,70]
[1,] -1.423686 -0.6818794 0.9138763 0.1475922 0.4529152 -0.658436 -0.6626895
[2,] -1.423686 -0.6818794 0.9138763 0.1475922 0.4529152 -0.658436 -0.6626895
        [,71]    [,72]     [,73]      [,74]     [,75]      [,76]     [,77]
[1,] 1.192537 0.994915 0.3039321 -0.5544602 -2.014418 -0.6978097 0.3107777
[2,] 1.192537 0.994915 0.3039321 -0.5544602 -2.014418 -0.6978097 0.3107777
         [,78]      [,79]     [,80]      [,81]    [,82]     [,83]    [,84]
[1,] 0.6317817 -0.8543882 -1.625472 0.03808515 1.850767 -0.056688 2.198613
[2,] 0.6317817 -0.8543882 -1.625472 0.03808515 1.850767 -0.056688 2.198613
          [,85]     [,86]     [,87]      [,88]    [,89]    [,90]     [,91]
[1,] -0.8265112 0.9415955 0.9932395 0.08347849 1.143452 1.051329 -1.220788
[2,] -0.8265112 0.9415955 0.9932395 0.08347849 1.143452 1.051329 -1.220788
          [,92]    [,93]     [,94]     [,95]      [,96]        [,97]     [,98]
[1,] -0.8452221 1.554208 0.3842896 0.1446213 -0.2540729 -0.001792306 -1.293255
[2,] -0.8452221 1.554208 0.3842896 0.1446213 -0.2540729 -0.001792306 -1.293255
         [,99]     [,100]
[1,] 0.4181883 -0.8281823
[2,] 0.4181883 -0.8281823
> 
> 
> Max(tmp2)
[1] 2.715974
> Min(tmp2)
[1] -2.410809
> mean(tmp2)
[1] -0.1146889
> Sum(tmp2)
[1] -11.46889
> Var(tmp2)
[1] 1.443422
> 
> rowMeans(tmp2)
  [1] -1.086684516 -1.690415110 -2.307061399 -0.817081353 -0.026055050
  [6] -0.165937535 -1.237893983 -1.501525381 -0.729208525 -2.410809091
 [11]  0.052642941  1.445308072 -0.729212604 -0.528329140  0.991178989
 [16] -1.141065821 -0.536483087 -0.041494909  0.590590455  0.245364637
 [21]  0.284936819 -1.996276306 -1.883240850 -0.404149013  0.034324471
 [26]  2.491175665  0.406553823  1.298959948 -1.230641811  0.949053900
 [31] -1.503432736 -0.004517184  0.122004444 -1.622224493 -0.498273112
 [36] -1.673926301  1.130492751  1.516558143  1.124570738  1.731252574
 [41] -0.084521524 -0.361038715  1.510802476 -2.189242146  0.572077655
 [46]  1.473487135 -0.400136622 -1.432688137  0.910215246  0.271180965
 [51]  0.213878685 -0.535348000  0.580186086 -0.377687526 -0.685846743
 [56]  0.833913577 -1.089025736  1.798958912 -0.847383914  0.854996575
 [61]  2.413657042 -1.964821368  1.292937988 -1.730297889 -0.106605053
 [66]  0.277038839 -0.467206810  0.311793714 -0.032660504 -2.228356507
 [71] -1.466575782  2.715973566 -1.025222995 -0.270500074 -1.548833544
 [76] -0.859532152  2.150365858 -0.589845793  1.225085908  0.569218253
 [81]  1.117041926  1.569258325 -0.049244777 -0.273835267 -0.937246410
 [86] -1.421959026 -0.366270690  0.138978749  1.700375067  1.445214154
 [91] -0.001338580 -1.075543620  0.909690187 -0.505330311  0.454707897
 [96]  1.943477880 -0.841069404 -1.232466701 -1.284324769 -1.090427814
> rowSums(tmp2)
  [1] -1.086684516 -1.690415110 -2.307061399 -0.817081353 -0.026055050
  [6] -0.165937535 -1.237893983 -1.501525381 -0.729208525 -2.410809091
 [11]  0.052642941  1.445308072 -0.729212604 -0.528329140  0.991178989
 [16] -1.141065821 -0.536483087 -0.041494909  0.590590455  0.245364637
 [21]  0.284936819 -1.996276306 -1.883240850 -0.404149013  0.034324471
 [26]  2.491175665  0.406553823  1.298959948 -1.230641811  0.949053900
 [31] -1.503432736 -0.004517184  0.122004444 -1.622224493 -0.498273112
 [36] -1.673926301  1.130492751  1.516558143  1.124570738  1.731252574
 [41] -0.084521524 -0.361038715  1.510802476 -2.189242146  0.572077655
 [46]  1.473487135 -0.400136622 -1.432688137  0.910215246  0.271180965
 [51]  0.213878685 -0.535348000  0.580186086 -0.377687526 -0.685846743
 [56]  0.833913577 -1.089025736  1.798958912 -0.847383914  0.854996575
 [61]  2.413657042 -1.964821368  1.292937988 -1.730297889 -0.106605053
 [66]  0.277038839 -0.467206810  0.311793714 -0.032660504 -2.228356507
 [71] -1.466575782  2.715973566 -1.025222995 -0.270500074 -1.548833544
 [76] -0.859532152  2.150365858 -0.589845793  1.225085908  0.569218253
 [81]  1.117041926  1.569258325 -0.049244777 -0.273835267 -0.937246410
 [86] -1.421959026 -0.366270690  0.138978749  1.700375067  1.445214154
 [91] -0.001338580 -1.075543620  0.909690187 -0.505330311  0.454707897
 [96]  1.943477880 -0.841069404 -1.232466701 -1.284324769 -1.090427814
> 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.086684516 -1.690415110 -2.307061399 -0.817081353 -0.026055050
  [6] -0.165937535 -1.237893983 -1.501525381 -0.729208525 -2.410809091
 [11]  0.052642941  1.445308072 -0.729212604 -0.528329140  0.991178989
 [16] -1.141065821 -0.536483087 -0.041494909  0.590590455  0.245364637
 [21]  0.284936819 -1.996276306 -1.883240850 -0.404149013  0.034324471
 [26]  2.491175665  0.406553823  1.298959948 -1.230641811  0.949053900
 [31] -1.503432736 -0.004517184  0.122004444 -1.622224493 -0.498273112
 [36] -1.673926301  1.130492751  1.516558143  1.124570738  1.731252574
 [41] -0.084521524 -0.361038715  1.510802476 -2.189242146  0.572077655
 [46]  1.473487135 -0.400136622 -1.432688137  0.910215246  0.271180965
 [51]  0.213878685 -0.535348000  0.580186086 -0.377687526 -0.685846743
 [56]  0.833913577 -1.089025736  1.798958912 -0.847383914  0.854996575
 [61]  2.413657042 -1.964821368  1.292937988 -1.730297889 -0.106605053
 [66]  0.277038839 -0.467206810  0.311793714 -0.032660504 -2.228356507
 [71] -1.466575782  2.715973566 -1.025222995 -0.270500074 -1.548833544
 [76] -0.859532152  2.150365858 -0.589845793  1.225085908  0.569218253
 [81]  1.117041926  1.569258325 -0.049244777 -0.273835267 -0.937246410
 [86] -1.421959026 -0.366270690  0.138978749  1.700375067  1.445214154
 [91] -0.001338580 -1.075543620  0.909690187 -0.505330311  0.454707897
 [96]  1.943477880 -0.841069404 -1.232466701 -1.284324769 -1.090427814
> rowMin(tmp2)
  [1] -1.086684516 -1.690415110 -2.307061399 -0.817081353 -0.026055050
  [6] -0.165937535 -1.237893983 -1.501525381 -0.729208525 -2.410809091
 [11]  0.052642941  1.445308072 -0.729212604 -0.528329140  0.991178989
 [16] -1.141065821 -0.536483087 -0.041494909  0.590590455  0.245364637
 [21]  0.284936819 -1.996276306 -1.883240850 -0.404149013  0.034324471
 [26]  2.491175665  0.406553823  1.298959948 -1.230641811  0.949053900
 [31] -1.503432736 -0.004517184  0.122004444 -1.622224493 -0.498273112
 [36] -1.673926301  1.130492751  1.516558143  1.124570738  1.731252574
 [41] -0.084521524 -0.361038715  1.510802476 -2.189242146  0.572077655
 [46]  1.473487135 -0.400136622 -1.432688137  0.910215246  0.271180965
 [51]  0.213878685 -0.535348000  0.580186086 -0.377687526 -0.685846743
 [56]  0.833913577 -1.089025736  1.798958912 -0.847383914  0.854996575
 [61]  2.413657042 -1.964821368  1.292937988 -1.730297889 -0.106605053
 [66]  0.277038839 -0.467206810  0.311793714 -0.032660504 -2.228356507
 [71] -1.466575782  2.715973566 -1.025222995 -0.270500074 -1.548833544
 [76] -0.859532152  2.150365858 -0.589845793  1.225085908  0.569218253
 [81]  1.117041926  1.569258325 -0.049244777 -0.273835267 -0.937246410
 [86] -1.421959026 -0.366270690  0.138978749  1.700375067  1.445214154
 [91] -0.001338580 -1.075543620  0.909690187 -0.505330311  0.454707897
 [96]  1.943477880 -0.841069404 -1.232466701 -1.284324769 -1.090427814
> 
> colMeans(tmp2)
[1] -0.1146889
> colSums(tmp2)
[1] -11.46889
> colVars(tmp2)
[1] 1.443422
> colSd(tmp2)
[1] 1.201425
> colMax(tmp2)
[1] 2.715974
> colMin(tmp2)
[1] -2.410809
> colMedians(tmp2)
[1] -0.1362713
> colRanges(tmp2)
          [,1]
[1,] -2.410809
[2,]  2.715974
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  3.0521071 -4.9164273 -0.2743446  0.3434314  2.6342426 -0.7064166
 [7] -0.2217362  1.0796655 11.6403225 -4.2660950
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.5679320
[2,] -1.2878100
[3,] -0.4682086
[4,]  1.6264598
[5,]  4.1151107
> 
> rowApply(tmp,sum)
 [1] -1.0017184 -5.4767495 -0.8625717  2.1858857  0.8757329  4.8709878
 [7] -0.9089851  1.5649662  7.7689293 -0.6517278
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    3    3    8    1    4    9    4   10   10     2
 [2,]    7    5    2    6    1    2    3    4    2     7
 [3,]    4   10    7    4    3    3    2    7    3     9
 [4,]    1    8    9    9    7    5    5    3    6     8
 [5,]   10    4    3    5    6    8    8    5    7     1
 [6,]    5    1   10    2    9    1    9    8    5     5
 [7,]    6    7    4    8    2    4    7    2    1    10
 [8,]    8    9    5    7    5    6    6    6    4     3
 [9,]    9    6    6   10    8    7   10    9    9     4
[10,]    2    2    1    3   10   10    1    1    8     6
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.3974508  2.5520620  1.5842284 -2.0339457 -2.2711020 -1.5855184
 [7] -2.8633631 -0.2522606  0.1292963  2.6584028 -0.7323544 -0.5926621
[13]  3.6216108 -1.1482782 -1.1489152 -1.7035024 -0.4974340 -0.3092676
[19] -0.8053199  1.0446170
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.2790203
[2,]  0.3443366
[3,]  0.5777077
[4,]  0.6277731
[5,]  1.1266537
> 
> rowApply(tmp,sum)
[1] -7.337409  4.690313  5.239582 -3.507733 -1.041008
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   11   15   12   16   15
[2,]   20   20    7    2   10
[3,]   18   13   10   14    9
[4,]   14    6    2    3   16
[5,]   12   12    3   11    1
> 
> 
> as.matrix(tmp)
           [,1]         [,2]        [,3]          [,4]       [,5]       [,6]
[1,] -0.2790203  1.709361536  0.56155241 -0.0008557812 -0.1958568 -1.0061038
[2,]  1.1266537  2.260614705  0.38715845 -0.2235193297  0.3599860  0.2117642
[3,]  0.6277731 -0.179819849  0.28276130 -1.0591163200 -1.0498318  0.7681460
[4,]  0.5777077 -1.232520738  0.41749011 -1.2000853732 -0.3752189 -1.1664557
[5,]  0.3443366 -0.005573666 -0.06473388  0.4496311377 -1.0101805 -0.3928691
            [,7]       [,8]       [,9]      [,10]       [,11]      [,12]
[1,] -1.67552379 -1.5027315  1.3620544 -0.6127544  0.43247291 -0.5735880
[2,]  1.63420263  1.2023656 -1.4737042 -1.2414733 -2.52047538 -0.3151063
[3,] -2.08779528  0.7681643  1.4978014  2.5955218  0.93323872  0.4872163
[4,] -0.81015859 -0.8645113 -0.5200590  1.2619790  0.33759000 -1.4365386
[5,]  0.07591192  0.1444521 -0.7367962  0.6551297  0.08481932  1.2453544
          [,13]      [,14]       [,15]      [,16]       [,17]       [,18]
[1,] -1.0519930 -0.1330549 -1.51490953 -1.3602643 -0.91973885  0.05088667
[2,]  1.2089616 -0.3559978 -0.02384568  2.0760497  0.13092771  0.47913303
[3,]  2.0169987  1.3147163 -0.92153675 -1.0220614  0.66315573 -0.71898573
[4,]  0.6491170 -1.1738066  1.40933654 -0.5594250 -0.45693234  0.54861756
[5,]  0.7985266 -0.8001351 -0.09795973 -0.8378014  0.08515379 -0.66891910
           [,19]      [,20]
[1,]  0.06409995 -0.6914425
[2,] -0.12883278 -0.1045493
[3,]  0.13441621  0.1888197
[4,] -0.09308796  1.1792290
[5,] -0.78191530  0.4725602
> 
> 
> 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 :  648  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 :  561  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 -1.05274 0.1397306 -0.8521588 0.01640678 1.195684 0.6985837 2.012567
          col8      col9      col10      col11      col12     col13     col14
row1 0.1218581 0.6162165 0.01231335 -0.2105066 0.02969581 0.5200042 0.5304439
         col15     col16      col17     col18     col19    col20
row1 0.4476588 0.4914105 -0.0148832 0.3061864 0.2627575 0.258201
> tmp[,"col10"]
           col10
row1  0.01231335
row2 -0.77649087
row3 -1.79335345
row4  0.74617653
row5 -0.23870401
> tmp[c("row1","row5"),]
           col1       col2       col3       col4        col5       col6
row1 -1.0527401  0.1397306 -0.8521588 0.01640678  1.19568398  0.6985837
row5  0.2444506 -0.5789607  0.1777422 0.65513283 -0.08908178 -0.6633757
           col7      col8       col9       col10      col11       col12
row1  2.0125674 0.1218581  0.6162165  0.01231335 -0.2105066  0.02969581
row5 -0.1392002 0.6312561 -0.2250901 -0.23870401 -0.5045989 -0.54630058
           col13      col14       col15     col16      col17     col18
row1  0.52000424  0.5304439  0.44765876 0.4914105 -0.0148832 0.3061864
row5 -0.08318991 -1.0530695 -0.05146256 1.2409184 -1.0622291 0.3880909
          col19      col20
row1  0.2627575  0.2582010
row5 -1.2155717 -0.5526901
> tmp[,c("col6","col20")]
            col6      col20
row1  0.69858365  0.2582010
row2 -0.03322753 -1.7203796
row3 -1.37243043 -1.5921560
row4 -0.31097156  0.2743397
row5 -0.66337566 -0.5526901
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1  0.6985837  0.2582010
row5 -0.6633757 -0.5526901
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3    col4     col5     col6     col7     col8
row1 50.83178 50.68049 49.55974 51.1861 50.35522 104.9169 50.21254 50.29633
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.56639 49.11563 49.99959 50.00766 49.61586 48.84001 49.68401 50.90626
        col17    col18    col19    col20
row1 49.11427 49.29419 50.93858 107.3061
> tmp[,"col10"]
        col10
row1 49.11563
row2 31.58170
row3 30.20214
row4 29.89509
row5 49.58582
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.83178 50.68049 49.55974 51.18610 50.35522 104.9169 50.21254 50.29633
row5 51.15734 52.14683 53.29585 49.29818 50.11433 106.8124 51.10341 50.66580
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.56639 49.11563 49.99959 50.00766 49.61586 48.84001 49.68401 50.90626
row5 49.84872 49.58582 52.83503 51.09870 49.40342 52.64916 51.09173 51.04400
        col17    col18    col19    col20
row1 49.11427 49.29419 50.93858 107.3061
row5 49.13937 49.34360 48.73750 104.0125
> tmp[,c("col6","col20")]
          col6     col20
row1 104.91689 107.30606
row2  76.03645  74.14623
row3  77.15032  75.79893
row4  74.74683  76.27102
row5 106.81240 104.01246
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.9169 107.3061
row5 106.8124 104.0125
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.9169 107.3061
row5 106.8124 104.0125
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.1910862
[2,] -0.5594592
[3,] -1.4348583
[4,] -0.1956247
[5,] -0.9454216
> tmp[,c("col17","col7")]
          col17        col7
[1,]  0.1238013 -0.37485902
[2,] -1.0106211  0.33960826
[3,] -1.9823065 -0.66447749
[4,]  1.4588846  1.03197834
[5,]  0.8329218  0.04534809
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,] -0.02446695  0.8564482
[2,]  1.32403527  0.6738561
[3,]  2.07300085 -0.3570702
[4,] -0.24911429 -1.1114868
[5,]  2.23110715 -0.9135722
> subBufferedMatrix(tmp,1,c("col6"))[,1]
            col1
[1,] -0.02446695
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
            col6
[1,] -0.02446695
[2,]  1.32403527
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]      [,2]       [,3]      [,4]       [,5]       [,6]       [,7]
row3 -1.557605  1.094953 -0.8369425 0.6723344 -0.9015243 -0.1232269 -0.5480046
row1  2.989034 -1.432472 -0.4300057 0.4579388  1.4908894  1.1181249 -1.2988050
          [,8]     [,9]      [,10]      [,11]     [,12]     [,13]      [,14]
row3 0.5387439 0.362376  0.6330894 -1.4769298 0.8322311 -1.199779 -0.5107415
row1 1.5425883 0.405177 -1.3539601 -0.6915709 1.0666785 -1.881836 -1.0394069
          [,15]     [,16]     [,17]      [,18]      [,19]      [,20]
row3 -0.8848502 0.1094377 0.5131815 -0.6243082 -0.3228142  0.5693729
row1 -0.2642361 1.0451923 1.7266085 -0.3269898  0.2190403 -0.8440954
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]       [,3]     [,4]   [,5]     [,6]      [,7]
row2 -0.9853386 0.9506668 -0.1886713 -1.84467 1.7629 1.561796 0.2424191
           [,8]      [,9]     [,10]
row2 -0.7408155 -1.548539 0.9950937
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]      [,3]       [,4]      [,5]      [,6]      [,7]
row5 0.7874569 0.6851367 -1.004904 -0.4137031 -1.032132 0.7216086 0.6663365
         [,8]       [,9]      [,10]      [,11]     [,12]      [,13]     [,14]
row5 1.387066 0.06642805 -0.6547311 -0.4396009 0.8675081 -0.8543982 0.5856721
         [,15]     [,16]     [,17]      [,18]      [,19]    [,20]
row5 -0.993017 -1.877314 0.3966538 -0.1333005 -0.7745075 1.284433
> 
> 
> 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: 0x57ce3c5c5e50>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM387965c5a1616"
 [2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM387961b19188a"
 [3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM38796953c9ef" 
 [4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM387963c62fbd7"
 [5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM387966888a36e"
 [6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM387967856d054"
 [7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3879666638112"
 [8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3879670cdd550"
 [9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM387961058b00b"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM387962188af00"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM387963becb6b8"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM38796689e5ede"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM387963d00cb92"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM387961df341fc"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3879671b4d319"
> 
> 
> ### 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: 0x57ce3d0e4150>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x57ce3d0e4150>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x57ce3d0e4150>
> rowMedians(tmp)
  [1]  0.185366176  0.308263717 -0.231245806  0.045931127 -0.204731620
  [6]  0.302475178 -0.363743601  0.794028461  0.602102572 -0.610482333
 [11] -0.253206158 -0.475195813 -0.078264359 -0.590488105  0.561345208
 [16]  0.093240459  0.142903599  0.057934322  0.108516969 -0.240317328
 [21]  0.041008591 -0.263488426  0.101292039  0.073042471 -0.138796417
 [26]  0.207699676 -0.048214655 -0.343993803 -0.496783192 -0.563671226
 [31]  0.092627880 -0.490868503 -0.083366587 -0.071392618  0.217965277
 [36] -0.041543785  0.005177812 -0.132260728  0.110434276  0.278577931
 [41]  0.352065870 -0.192126621  0.132828620  0.307464789 -0.247145094
 [46]  0.486182467  0.426769092 -0.803907948  0.497224167 -0.632474858
 [51]  0.174431244  0.176556788  0.140679742 -0.580418762  0.591677267
 [56]  0.624400707  0.137335532  0.469586383 -0.063181228  0.332531084
 [61] -0.342195895  0.373504984 -0.473955986  0.114391002  0.058229761
 [66] -0.318361683  0.171485585 -0.728231216 -0.248348573 -0.576464820
 [71]  0.065712981  0.269615229  0.322365825  0.054522424 -0.470635524
 [76] -0.414832729  0.130669674  0.454174586 -0.317196959  0.157173267
 [81] -0.515912686  0.594029772 -0.256844974  0.054729238  0.371816405
 [86] -0.282555627  0.313075086 -0.491995255 -0.133823933 -0.227420733
 [91]  0.097513296 -0.309878131  0.328193180  0.384263742  0.177818611
 [96]  0.218748089  0.296649480 -0.142731647 -0.165760805  0.428640960
[101]  0.266396343 -0.161601236 -0.603256705 -0.107704819 -0.530956181
[106]  0.517662977 -0.310748340 -0.164261391 -0.126756715 -0.344273415
[111] -0.034254396  0.207977214 -0.605663987  0.173467266 -0.681365091
[116] -0.370034927  0.117785494  0.159964699  0.714931711 -0.013082383
[121]  0.085989849  0.243409413 -0.120527485  0.071195467 -0.008922691
[126]  0.464142939 -0.103024809  0.321762015 -0.069783217 -0.283685136
[131] -0.691946299  0.568007387  0.053692608 -0.009880407 -0.321221381
[136]  0.864800462  0.010084115  0.178384206  0.277831147  0.435526526
[141]  0.082593911  0.260487764  0.400517191 -0.194538200  0.674163423
[146] -0.105362973 -0.225203104  0.247540508 -0.100904498 -0.094775175
[151] -0.444799336 -0.422361668  0.046577937  0.331486150 -0.285265458
[156]  0.010425382 -0.012903894 -0.324588784 -0.244523673 -0.151311331
[161]  0.834521569 -0.306715258 -0.119889258 -0.073042754 -0.214259349
[166] -0.273406476  0.086038076 -0.408883032 -0.103412730 -0.753453191
[171] -0.346541717  0.491344848 -0.094211309  0.082441765 -0.436009536
[176] -0.178781272  0.326125578  0.468172723 -0.361115103 -0.718743072
[181]  0.524901869 -0.314340335  0.440102065 -0.234475614 -0.216113369
[186] -0.482690724  0.193684804  0.075576876  0.339655378  0.565545362
[191]  0.240631044  0.340023942  0.170103734 -0.244274235  0.453202480
[196] -0.600232261 -0.169907336  0.129738949 -0.715394490 -0.021819100
[201]  0.120554830  0.517573341  0.235751904  0.329192825 -0.032377768
[206] -0.180380875  0.359432592 -0.077860814 -0.051720254 -0.194334348
[211] -0.170751349 -0.614479556  0.282202216 -0.121426074  0.037972992
[216]  0.181552594 -0.068802787  0.402561887  0.038274926 -0.155192233
[221] -0.031369309  0.395697538  0.231587643 -0.076787237  0.109505591
[226]  0.587162784 -0.217394884  0.164659452 -0.430921887  0.394714624
> 
> proc.time()
   user  system elapsed 
  1.283   1.517   2.790 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.6.0 alpha (2026-04-05 r89794)
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: 0x5e83ea07bff0>
> .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: 0x5e83ea07bff0>
> .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: 0x5e83ea07bff0>
> .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: 0x5e83ea07bff0>
> 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: 0x5e83e9c9aa60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e83e9c9aa60>
> .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: 0x5e83e9c9aa60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e83e9c9aa60>
> .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: 0x5e83e9c9aa60>
> 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: 0x5e83e9a00240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e83e9a00240>
> .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: 0x5e83e9a00240>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5e83e9a00240>
> .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: 0x5e83e9a00240>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x5e83e9a00240>
> .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: 0x5e83e9a00240>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x5e83e9a00240>
> .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: 0x5e83e9a00240>
> 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: 0x5e83eaa41160>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5e83eaa41160>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e83eaa41160>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e83eaa41160>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile38a0f2eb64b3e" "BufferedMatrixFile38a0f3e2e8852"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile38a0f2eb64b3e" "BufferedMatrixFile38a0f3e2e8852"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e83eacb2d20>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e83eacb2d20>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5e83eacb2d20>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5e83eacb2d20>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5e83eacb2d20>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5e83eacb2d20>
> .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: 0x5e83ea281f50>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e83ea281f50>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5e83ea281f50>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5e83ea281f50>
> 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: 0x5e83ebdf1be0>
> .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: 0x5e83ebdf1be0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.249   0.054   0.288 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.6.0 alpha (2026-04-05 r89794)
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.254   0.044   0.285 

Example timings