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

This page was generated on 2025-11-15 11:58 -0500 (Sat, 15 Nov 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 Patched (2025-08-23 r88802) -- "Great Square Root" 4903
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4668
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 257/2361HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.74.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-11-14 13:45 -0500 (Fri, 14 Nov 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_22
git_last_commit: d2ce144
git_last_commit_date: 2025-10-29 09:58:55 -0500 (Wed, 29 Oct 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
taishanLinux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on nebbiolo2

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.74.0
Command: /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.74.0.tar.gz
StartedAt: 2025-11-14 21:48:59 -0500 (Fri, 14 Nov 2025)
EndedAt: 2025-11-14 21:49:24 -0500 (Fri, 14 Nov 2025)
EllapsedTime: 25.2 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.1 Patched (2025-08-23 r88802)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
    gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
    GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
* running under: Ubuntu 24.04.3 LTS
* using session charset: UTF-8
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.74.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... OK
* used C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
Note: information on .o files is not available
* 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: 2 NOTEs
See
  ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/home/biocbuild/bbs-3.22-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-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.22-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.22-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.22-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.22-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.22-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.22-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.5.1 Patched (2025-08-23 r88802) -- "Great Square Root"
Copyright (C) 2025 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.242   0.048   0.277 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root"
Copyright (C) 2025 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.22-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 478419 25.6    1047111   56   639600 34.2
Vcells 885237  6.8    8388608   64  2081604 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Nov 14 21:49:15 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Nov 14 21:49:15 2025"
> 
> 
> 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: 0x557b9e3bfb10>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Nov 14 21:49:15 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Nov 14 21:49:15 2025"
> 
> ColMode(tmp2)
<pointer: 0x557b9e3bfb10>
> 
> 
> 
> ### 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,] 100.3472256 -0.5570025  0.02617937 -1.58561621
[2,]   1.4826985 -0.5965289 -0.33455834 -1.07109181
[3,]   1.8383962  0.8671411  1.24523859  0.07097501
[4,]   0.3263431 -1.0672656 -0.59882374  2.17553706
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]       [,3]       [,4]
[1,] 100.3472256 0.5570025 0.02617937 1.58561621
[2,]   1.4826985 0.5965289 0.33455834 1.07109181
[3,]   1.8383962 0.8671411 1.24523859 0.07097501
[4,]   0.3263431 1.0672656 0.59882374 2.17553706
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0173462 0.7463260 0.1618004 1.2592125
[2,]  1.2176611 0.7723528 0.5784102 1.0349357
[3,]  1.3558747 0.9312041 1.1159026 0.2664114
[4,]  0.5712644 1.0330855 0.7738370 1.4749702
> 
> 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.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.52069 33.02026 26.64418 39.17774
[2,]  38.65931 33.32006 31.11866 36.42045
[3,]  40.39714 35.17918 37.40426 27.73509
[4,]  31.03899 36.39812 33.33719 41.92524
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x557b9ddbd5c0>
> exp(tmp5)
<pointer: 0x557b9ddbd5c0>
> log(tmp5,2)
<pointer: 0x557b9ddbd5c0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.3918
> Min(tmp5)
[1] 54.89281
> mean(tmp5)
[1] 73.48929
> Sum(tmp5)
[1] 14697.86
> Var(tmp5)
[1] 868.9734
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.00138 71.50743 70.95777 73.46570 70.69376 70.82884 72.11960 69.60013
 [9] 71.15502 74.56326
> rowSums(tmp5)
 [1] 1800.028 1430.149 1419.155 1469.314 1413.875 1416.577 1442.392 1392.003
 [9] 1423.100 1491.265
> rowVars(tmp5)
 [1] 8086.40286   52.49092   68.47658   49.62345   77.77108  102.77486
 [7]   61.27862   78.80834   64.61020  120.71356
> rowSd(tmp5)
 [1] 89.924429  7.245062  8.275058  7.044391  8.818791 10.137794  7.828066
 [8]  8.877406  8.038047 10.986972
> rowMax(tmp5)
 [1] 469.39176  89.10327  84.08136  89.01655  84.69433  88.72429  86.14996
 [8]  87.96499  89.84252  94.85088
> rowMin(tmp5)
 [1] 55.45638 60.73691 57.72695 62.88486 55.07627 55.17756 54.89281 55.16247
 [9] 58.40588 56.87835
> 
> colMeans(tmp5)
 [1] 109.68783  70.06727  69.60461  72.51026  71.71321  73.47464  70.52841
 [8]  71.62270  71.77606  72.24413  68.52333  73.01996  73.64664  76.18514
[15]  66.93855  69.05602  72.27156  71.16272  70.77273  74.98001
> colSums(tmp5)
 [1] 1096.8783  700.6727  696.0461  725.1026  717.1321  734.7464  705.2841
 [8]  716.2270  717.7606  722.4413  685.2333  730.1996  736.4664  761.8514
[15]  669.3855  690.5602  722.7156  711.6272  707.7273  749.8001
> colVars(tmp5)
 [1] 16028.83698   123.17210    64.80431   101.33897    73.32322    71.65679
 [7]    94.64625    70.10602   122.35358    76.44236    47.26216   112.13489
[13]    23.86560   124.81304    41.14298    83.58100    39.90364    65.98110
[19]   109.15142   106.98258
> colSd(tmp5)
 [1] 126.605043  11.098293   8.050112  10.066726   8.562898   8.465033
 [7]   9.728631   8.372934  11.061355   8.743132   6.874748  10.589376
[13]   4.885243  11.171976   6.414280   9.142264   6.316933   8.122875
[19]  10.447556  10.343238
> colMax(tmp5)
 [1] 469.39176  94.07226  82.59692  87.26189  83.49434  89.10327  89.01655
 [8]  87.96499  87.14911  88.72429  78.35889  89.84252  81.54439  94.85088
[15]  78.45371  80.68921  88.75387  81.04299  86.14996  96.28916
> colMin(tmp5)
 [1] 61.71275 55.89420 55.45638 57.72695 55.17756 61.93712 56.52314 59.77909
 [9] 54.89281 59.87074 59.73315 56.41632 66.89933 58.09584 59.18310 55.16247
[17] 67.25849 60.40517 58.20793 56.87835
> 
> 
> ### 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] 90.00138 71.50743 70.95777 73.46570 70.69376 70.82884       NA 69.60013
 [9] 71.15502 74.56326
> rowSums(tmp5)
 [1] 1800.028 1430.149 1419.155 1469.314 1413.875 1416.577       NA 1392.003
 [9] 1423.100 1491.265
> rowVars(tmp5)
 [1] 8086.40286   52.49092   68.47658   49.62345   77.77108  102.77486
 [7]   64.68067   78.80834   64.61020  120.71356
> rowSd(tmp5)
 [1] 89.924429  7.245062  8.275058  7.044391  8.818791 10.137794  8.042429
 [8]  8.877406  8.038047 10.986972
> rowMax(tmp5)
 [1] 469.39176  89.10327  84.08136  89.01655  84.69433  88.72429        NA
 [8]  87.96499  89.84252  94.85088
> rowMin(tmp5)
 [1] 55.45638 60.73691 57.72695 62.88486 55.07627 55.17756       NA 55.16247
 [9] 58.40588 56.87835
> 
> colMeans(tmp5)
 [1] 109.68783  70.06727  69.60461  72.51026  71.71321        NA  70.52841
 [8]  71.62270  71.77606  72.24413  68.52333  73.01996  73.64664  76.18514
[15]  66.93855  69.05602  72.27156  71.16272  70.77273  74.98001
> colSums(tmp5)
 [1] 1096.8783  700.6727  696.0461  725.1026  717.1321        NA  705.2841
 [8]  716.2270  717.7606  722.4413  685.2333  730.1996  736.4664  761.8514
[15]  669.3855  690.5602  722.7156  711.6272  707.7273  749.8001
> colVars(tmp5)
 [1] 16028.83698   123.17210    64.80431   101.33897    73.32322          NA
 [7]    94.64625    70.10602   122.35358    76.44236    47.26216   112.13489
[13]    23.86560   124.81304    41.14298    83.58100    39.90364    65.98110
[19]   109.15142   106.98258
> colSd(tmp5)
 [1] 126.605043  11.098293   8.050112  10.066726   8.562898         NA
 [7]   9.728631   8.372934  11.061355   8.743132   6.874748  10.589376
[13]   4.885243  11.171976   6.414280   9.142264   6.316933   8.122875
[19]  10.447556  10.343238
> colMax(tmp5)
 [1] 469.39176  94.07226  82.59692  87.26189  83.49434        NA  89.01655
 [8]  87.96499  87.14911  88.72429  78.35889  89.84252  81.54439  94.85088
[15]  78.45371  80.68921  88.75387  81.04299  86.14996  96.28916
> colMin(tmp5)
 [1] 61.71275 55.89420 55.45638 57.72695 55.17756       NA 56.52314 59.77909
 [9] 54.89281 59.87074 59.73315 56.41632 66.89933 58.09584 59.18310 55.16247
[17] 67.25849 60.40517 58.20793 56.87835
> 
> Max(tmp5,na.rm=TRUE)
[1] 469.3918
> Min(tmp5,na.rm=TRUE)
[1] 54.89281
> mean(tmp5,na.rm=TRUE)
[1] 73.49517
> Sum(tmp5,na.rm=TRUE)
[1] 14625.54
> Var(tmp5,na.rm=TRUE)
[1] 873.3552
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.00138 71.50743 70.95777 73.46570 70.69376 70.82884 72.10912 69.60013
 [9] 71.15502 74.56326
> rowSums(tmp5,na.rm=TRUE)
 [1] 1800.028 1430.149 1419.155 1469.314 1413.875 1416.577 1370.073 1392.003
 [9] 1423.100 1491.265
> rowVars(tmp5,na.rm=TRUE)
 [1] 8086.40286   52.49092   68.47658   49.62345   77.77108  102.77486
 [7]   64.68067   78.80834   64.61020  120.71356
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.924429  7.245062  8.275058  7.044391  8.818791 10.137794  8.042429
 [8]  8.877406  8.038047 10.986972
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.39176  89.10327  84.08136  89.01655  84.69433  88.72429  86.14996
 [8]  87.96499  89.84252  94.85088
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.45638 60.73691 57.72695 62.88486 55.07627 55.17756 54.89281 55.16247
 [9] 58.40588 56.87835
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.68783  70.06727  69.60461  72.51026  71.71321  73.60307  70.52841
 [8]  71.62270  71.77606  72.24413  68.52333  73.01996  73.64664  76.18514
[15]  66.93855  69.05602  72.27156  71.16272  70.77273  74.98001
> colSums(tmp5,na.rm=TRUE)
 [1] 1096.8783  700.6727  696.0461  725.1026  717.1321  662.4277  705.2841
 [8]  716.2270  717.7606  722.4413  685.2333  730.1996  736.4664  761.8514
[15]  669.3855  690.5602  722.7156  711.6272  707.7273  749.8001
> colVars(tmp5,na.rm=TRUE)
 [1] 16028.83698   123.17210    64.80431   101.33897    73.32322    80.42831
 [7]    94.64625    70.10602   122.35358    76.44236    47.26216   112.13489
[13]    23.86560   124.81304    41.14298    83.58100    39.90364    65.98110
[19]   109.15142   106.98258
> colSd(tmp5,na.rm=TRUE)
 [1] 126.605043  11.098293   8.050112  10.066726   8.562898   8.968183
 [7]   9.728631   8.372934  11.061355   8.743132   6.874748  10.589376
[13]   4.885243  11.171976   6.414280   9.142264   6.316933   8.122875
[19]  10.447556  10.343238
> colMax(tmp5,na.rm=TRUE)
 [1] 469.39176  94.07226  82.59692  87.26189  83.49434  89.10327  89.01655
 [8]  87.96499  87.14911  88.72429  78.35889  89.84252  81.54439  94.85088
[15]  78.45371  80.68921  88.75387  81.04299  86.14996  96.28916
> colMin(tmp5,na.rm=TRUE)
 [1] 61.71275 55.89420 55.45638 57.72695 55.17756 61.93712 56.52314 59.77909
 [9] 54.89281 59.87074 59.73315 56.41632 66.89933 58.09584 59.18310 55.16247
[17] 67.25849 60.40517 58.20793 56.87835
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.00138 71.50743 70.95777 73.46570 70.69376 70.82884      NaN 69.60013
 [9] 71.15502 74.56326
> rowSums(tmp5,na.rm=TRUE)
 [1] 1800.028 1430.149 1419.155 1469.314 1413.875 1416.577    0.000 1392.003
 [9] 1423.100 1491.265
> rowVars(tmp5,na.rm=TRUE)
 [1] 8086.40286   52.49092   68.47658   49.62345   77.77108  102.77486
 [7]         NA   78.80834   64.61020  120.71356
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.924429  7.245062  8.275058  7.044391  8.818791 10.137794        NA
 [8]  8.877406  8.038047 10.986972
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.39176  89.10327  84.08136  89.01655  84.69433  88.72429        NA
 [8]  87.96499  89.84252  94.85088
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.45638 60.73691 57.72695 62.88486 55.07627 55.17756       NA 55.16247
 [9] 58.40588 56.87835
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.86785  69.28255  68.93293  73.07007  72.21046       NaN  72.08455
 [8]  71.82798  73.65198  71.47510  67.71969  73.29113  73.47204  75.86531
[15]  66.70649  68.55235  72.46022  70.44507  69.06415  74.24654
> colSums(tmp5,na.rm=TRUE)
 [1] 1033.8106  623.5430  620.3964  657.6307  649.8941    0.0000  648.7610
 [8]  646.4518  662.8678  643.2759  609.4772  659.6202  661.2483  682.7878
[15]  600.3584  616.9712  652.1419  634.0057  621.5773  668.2189
> colVars(tmp5,na.rm=TRUE)
 [1] 17730.57509   131.64099    67.82930   110.48072    79.70704          NA
 [7]    79.23430    78.39521    98.05832    79.34449    45.90426   125.32450
[13]    26.50581   139.26392    45.68002    91.17475    44.49121    68.43479
[19]    89.95380   114.30324
> colSd(tmp5,na.rm=TRUE)
 [1] 133.156206  11.473491   8.235854  10.510981   8.927880         NA
 [7]   8.901365   8.854107   9.902440   8.907552   6.775268  11.194842
[13]   5.148379  11.801013   6.758699   9.548547   6.670173   8.272532
[19]   9.484398  10.691270
> colMax(tmp5,na.rm=TRUE)
 [1] 469.39176  94.07226  82.59692  87.26189  83.49434      -Inf  89.01655
 [8]  87.96499  87.14911  88.72429  78.35889  89.84252  81.54439  94.85088
[15]  78.45371  80.68921  88.75387  81.04299  85.68495  96.28916
> colMin(tmp5,na.rm=TRUE)
 [1] 61.71275 55.89420 55.45638 57.72695 55.17756      Inf 61.19179 59.77909
 [9] 55.07627 59.87074 59.73315 56.41632 66.89933 58.09584 59.18310 55.16247
[17] 67.25849 60.40517 58.20793 56.87835
> 
> 
> 
> 
> 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] 187.4854 408.4117  82.6319 352.1825 202.6243 176.3290 209.0141 147.1944
 [9] 380.3011 183.1125
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 187.4854 408.4117  82.6319 352.1825 202.6243 176.3290 209.0141 147.1944
 [9] 380.3011 183.1125
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  2.842171e-14  5.684342e-14  5.684342e-14  0.000000e+00  5.684342e-14
 [6]  1.421085e-14  9.947598e-14  5.684342e-14  0.000000e+00 -2.842171e-14
[11] -1.705303e-13 -1.705303e-13  5.684342e-14  5.684342e-14  2.273737e-13
[16]  0.000000e+00 -1.136868e-13  1.136868e-13  1.421085e-13 -1.421085e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
10   4 
10   1 
3   8 
6   2 
4   12 
1   12 
8   11 
2   3 
7   13 
2   4 
10   10 
1   15 
3   13 
2   9 
3   12 
5   2 
8   2 
1   17 
7   13 
5   7 
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.804275
> Min(tmp)
[1] -2.280138
> mean(tmp)
[1] 0.03672538
> Sum(tmp)
[1] 3.672538
> Var(tmp)
[1] 0.9502558
> 
> rowMeans(tmp)
[1] 0.03672538
> rowSums(tmp)
[1] 3.672538
> rowVars(tmp)
[1] 0.9502558
> rowSd(tmp)
[1] 0.9748107
> rowMax(tmp)
[1] 2.804275
> rowMin(tmp)
[1] -2.280138
> 
> colMeans(tmp)
  [1] -2.28013758  1.44259583  0.78576485 -0.67422462 -0.96815466 -0.50081674
  [7] -0.33963525 -0.38726696 -0.22713554 -0.96363268  2.14864138  0.79762365
 [13] -0.48536888  0.44534588 -0.48905903 -1.19504032 -1.87748662  0.90923109
 [19] -0.50335045  1.18356903 -0.54916344 -0.28214651 -0.03116380 -0.41710156
 [25]  0.54594802 -0.75559340  0.40587919  0.95026630 -0.17151385 -2.03468140
 [31]  0.01758868  0.30409064 -0.11267933  0.72658832 -0.40385690 -0.41366180
 [37]  1.21500093  0.18311189 -0.83281061  1.14547584  0.23297722  1.72933198
 [43] -0.83319508 -0.96262294 -0.38696336  0.74103037  0.71665959  0.44942759
 [49] -1.72466818 -0.66046839 -1.28907277  0.46859279  0.72521008  1.24120332
 [55]  0.23533908  0.49726555  0.11249254 -0.14535191 -0.74189347  2.80427453
 [61]  1.89343950  0.45595832 -0.40522037  2.17659494 -0.94133058 -0.36045791
 [67]  0.54502457  1.51032069  0.16487824  0.20684629 -0.58683602 -1.19738660
 [73]  0.77228496  0.62517688 -0.38567052 -0.15965305 -0.69650092 -0.01385687
 [79]  0.80808665  0.25860638 -1.50899965 -1.15419092  0.57585299 -0.13226154
 [85]  0.17565680  0.04229494 -0.36855308 -1.81170954  1.88003958 -0.27671603
 [91]  0.96661409 -0.29293479  0.88423842 -1.38062495  0.55585306  1.06613729
 [97] -1.16947765 -0.41593803  1.55833845  0.28800584
> colSums(tmp)
  [1] -2.28013758  1.44259583  0.78576485 -0.67422462 -0.96815466 -0.50081674
  [7] -0.33963525 -0.38726696 -0.22713554 -0.96363268  2.14864138  0.79762365
 [13] -0.48536888  0.44534588 -0.48905903 -1.19504032 -1.87748662  0.90923109
 [19] -0.50335045  1.18356903 -0.54916344 -0.28214651 -0.03116380 -0.41710156
 [25]  0.54594802 -0.75559340  0.40587919  0.95026630 -0.17151385 -2.03468140
 [31]  0.01758868  0.30409064 -0.11267933  0.72658832 -0.40385690 -0.41366180
 [37]  1.21500093  0.18311189 -0.83281061  1.14547584  0.23297722  1.72933198
 [43] -0.83319508 -0.96262294 -0.38696336  0.74103037  0.71665959  0.44942759
 [49] -1.72466818 -0.66046839 -1.28907277  0.46859279  0.72521008  1.24120332
 [55]  0.23533908  0.49726555  0.11249254 -0.14535191 -0.74189347  2.80427453
 [61]  1.89343950  0.45595832 -0.40522037  2.17659494 -0.94133058 -0.36045791
 [67]  0.54502457  1.51032069  0.16487824  0.20684629 -0.58683602 -1.19738660
 [73]  0.77228496  0.62517688 -0.38567052 -0.15965305 -0.69650092 -0.01385687
 [79]  0.80808665  0.25860638 -1.50899965 -1.15419092  0.57585299 -0.13226154
 [85]  0.17565680  0.04229494 -0.36855308 -1.81170954  1.88003958 -0.27671603
 [91]  0.96661409 -0.29293479  0.88423842 -1.38062495  0.55585306  1.06613729
 [97] -1.16947765 -0.41593803  1.55833845  0.28800584
> 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] -2.28013758  1.44259583  0.78576485 -0.67422462 -0.96815466 -0.50081674
  [7] -0.33963525 -0.38726696 -0.22713554 -0.96363268  2.14864138  0.79762365
 [13] -0.48536888  0.44534588 -0.48905903 -1.19504032 -1.87748662  0.90923109
 [19] -0.50335045  1.18356903 -0.54916344 -0.28214651 -0.03116380 -0.41710156
 [25]  0.54594802 -0.75559340  0.40587919  0.95026630 -0.17151385 -2.03468140
 [31]  0.01758868  0.30409064 -0.11267933  0.72658832 -0.40385690 -0.41366180
 [37]  1.21500093  0.18311189 -0.83281061  1.14547584  0.23297722  1.72933198
 [43] -0.83319508 -0.96262294 -0.38696336  0.74103037  0.71665959  0.44942759
 [49] -1.72466818 -0.66046839 -1.28907277  0.46859279  0.72521008  1.24120332
 [55]  0.23533908  0.49726555  0.11249254 -0.14535191 -0.74189347  2.80427453
 [61]  1.89343950  0.45595832 -0.40522037  2.17659494 -0.94133058 -0.36045791
 [67]  0.54502457  1.51032069  0.16487824  0.20684629 -0.58683602 -1.19738660
 [73]  0.77228496  0.62517688 -0.38567052 -0.15965305 -0.69650092 -0.01385687
 [79]  0.80808665  0.25860638 -1.50899965 -1.15419092  0.57585299 -0.13226154
 [85]  0.17565680  0.04229494 -0.36855308 -1.81170954  1.88003958 -0.27671603
 [91]  0.96661409 -0.29293479  0.88423842 -1.38062495  0.55585306  1.06613729
 [97] -1.16947765 -0.41593803  1.55833845  0.28800584
> colMin(tmp)
  [1] -2.28013758  1.44259583  0.78576485 -0.67422462 -0.96815466 -0.50081674
  [7] -0.33963525 -0.38726696 -0.22713554 -0.96363268  2.14864138  0.79762365
 [13] -0.48536888  0.44534588 -0.48905903 -1.19504032 -1.87748662  0.90923109
 [19] -0.50335045  1.18356903 -0.54916344 -0.28214651 -0.03116380 -0.41710156
 [25]  0.54594802 -0.75559340  0.40587919  0.95026630 -0.17151385 -2.03468140
 [31]  0.01758868  0.30409064 -0.11267933  0.72658832 -0.40385690 -0.41366180
 [37]  1.21500093  0.18311189 -0.83281061  1.14547584  0.23297722  1.72933198
 [43] -0.83319508 -0.96262294 -0.38696336  0.74103037  0.71665959  0.44942759
 [49] -1.72466818 -0.66046839 -1.28907277  0.46859279  0.72521008  1.24120332
 [55]  0.23533908  0.49726555  0.11249254 -0.14535191 -0.74189347  2.80427453
 [61]  1.89343950  0.45595832 -0.40522037  2.17659494 -0.94133058 -0.36045791
 [67]  0.54502457  1.51032069  0.16487824  0.20684629 -0.58683602 -1.19738660
 [73]  0.77228496  0.62517688 -0.38567052 -0.15965305 -0.69650092 -0.01385687
 [79]  0.80808665  0.25860638 -1.50899965 -1.15419092  0.57585299 -0.13226154
 [85]  0.17565680  0.04229494 -0.36855308 -1.81170954  1.88003958 -0.27671603
 [91]  0.96661409 -0.29293479  0.88423842 -1.38062495  0.55585306  1.06613729
 [97] -1.16947765 -0.41593803  1.55833845  0.28800584
> colMedians(tmp)
  [1] -2.28013758  1.44259583  0.78576485 -0.67422462 -0.96815466 -0.50081674
  [7] -0.33963525 -0.38726696 -0.22713554 -0.96363268  2.14864138  0.79762365
 [13] -0.48536888  0.44534588 -0.48905903 -1.19504032 -1.87748662  0.90923109
 [19] -0.50335045  1.18356903 -0.54916344 -0.28214651 -0.03116380 -0.41710156
 [25]  0.54594802 -0.75559340  0.40587919  0.95026630 -0.17151385 -2.03468140
 [31]  0.01758868  0.30409064 -0.11267933  0.72658832 -0.40385690 -0.41366180
 [37]  1.21500093  0.18311189 -0.83281061  1.14547584  0.23297722  1.72933198
 [43] -0.83319508 -0.96262294 -0.38696336  0.74103037  0.71665959  0.44942759
 [49] -1.72466818 -0.66046839 -1.28907277  0.46859279  0.72521008  1.24120332
 [55]  0.23533908  0.49726555  0.11249254 -0.14535191 -0.74189347  2.80427453
 [61]  1.89343950  0.45595832 -0.40522037  2.17659494 -0.94133058 -0.36045791
 [67]  0.54502457  1.51032069  0.16487824  0.20684629 -0.58683602 -1.19738660
 [73]  0.77228496  0.62517688 -0.38567052 -0.15965305 -0.69650092 -0.01385687
 [79]  0.80808665  0.25860638 -1.50899965 -1.15419092  0.57585299 -0.13226154
 [85]  0.17565680  0.04229494 -0.36855308 -1.81170954  1.88003958 -0.27671603
 [91]  0.96661409 -0.29293479  0.88423842 -1.38062495  0.55585306  1.06613729
 [97] -1.16947765 -0.41593803  1.55833845  0.28800584
> colRanges(tmp)
          [,1]     [,2]      [,3]       [,4]       [,5]       [,6]       [,7]
[1,] -2.280138 1.442596 0.7857649 -0.6742246 -0.9681547 -0.5008167 -0.3396353
[2,] -2.280138 1.442596 0.7857649 -0.6742246 -0.9681547 -0.5008167 -0.3396353
          [,8]       [,9]      [,10]    [,11]     [,12]      [,13]     [,14]
[1,] -0.387267 -0.2271355 -0.9636327 2.148641 0.7976237 -0.4853689 0.4453459
[2,] -0.387267 -0.2271355 -0.9636327 2.148641 0.7976237 -0.4853689 0.4453459
         [,15]    [,16]     [,17]     [,18]      [,19]    [,20]      [,21]
[1,] -0.489059 -1.19504 -1.877487 0.9092311 -0.5033504 1.183569 -0.5491634
[2,] -0.489059 -1.19504 -1.877487 0.9092311 -0.5033504 1.183569 -0.5491634
          [,22]      [,23]      [,24]    [,25]      [,26]     [,27]     [,28]
[1,] -0.2821465 -0.0311638 -0.4171016 0.545948 -0.7555934 0.4058792 0.9502663
[2,] -0.2821465 -0.0311638 -0.4171016 0.545948 -0.7555934 0.4058792 0.9502663
          [,29]     [,30]      [,31]     [,32]      [,33]     [,34]      [,35]
[1,] -0.1715139 -2.034681 0.01758868 0.3040906 -0.1126793 0.7265883 -0.4038569
[2,] -0.1715139 -2.034681 0.01758868 0.3040906 -0.1126793 0.7265883 -0.4038569
          [,36]    [,37]     [,38]      [,39]    [,40]     [,41]    [,42]
[1,] -0.4136618 1.215001 0.1831119 -0.8328106 1.145476 0.2329772 1.729332
[2,] -0.4136618 1.215001 0.1831119 -0.8328106 1.145476 0.2329772 1.729332
          [,43]      [,44]      [,45]     [,46]     [,47]     [,48]     [,49]
[1,] -0.8331951 -0.9626229 -0.3869634 0.7410304 0.7166596 0.4494276 -1.724668
[2,] -0.8331951 -0.9626229 -0.3869634 0.7410304 0.7166596 0.4494276 -1.724668
          [,50]     [,51]     [,52]     [,53]    [,54]     [,55]     [,56]
[1,] -0.6604684 -1.289073 0.4685928 0.7252101 1.241203 0.2353391 0.4972656
[2,] -0.6604684 -1.289073 0.4685928 0.7252101 1.241203 0.2353391 0.4972656
         [,57]      [,58]      [,59]    [,60]   [,61]     [,62]      [,63]
[1,] 0.1124925 -0.1453519 -0.7418935 2.804275 1.89344 0.4559583 -0.4052204
[2,] 0.1124925 -0.1453519 -0.7418935 2.804275 1.89344 0.4559583 -0.4052204
        [,64]      [,65]      [,66]     [,67]    [,68]     [,69]     [,70]
[1,] 2.176595 -0.9413306 -0.3604579 0.5450246 1.510321 0.1648782 0.2068463
[2,] 2.176595 -0.9413306 -0.3604579 0.5450246 1.510321 0.1648782 0.2068463
         [,71]     [,72]    [,73]     [,74]      [,75]     [,76]      [,77]
[1,] -0.586836 -1.197387 0.772285 0.6251769 -0.3856705 -0.159653 -0.6965009
[2,] -0.586836 -1.197387 0.772285 0.6251769 -0.3856705 -0.159653 -0.6965009
           [,78]     [,79]     [,80]  [,81]     [,82]    [,83]      [,84]
[1,] -0.01385687 0.8080867 0.2586064 -1.509 -1.154191 0.575853 -0.1322615
[2,] -0.01385687 0.8080867 0.2586064 -1.509 -1.154191 0.575853 -0.1322615
         [,85]      [,86]      [,87]    [,88]   [,89]     [,90]     [,91]
[1,] 0.1756568 0.04229494 -0.3685531 -1.81171 1.88004 -0.276716 0.9666141
[2,] 0.1756568 0.04229494 -0.3685531 -1.81171 1.88004 -0.276716 0.9666141
          [,92]     [,93]     [,94]     [,95]    [,96]     [,97]     [,98]
[1,] -0.2929348 0.8842384 -1.380625 0.5558531 1.066137 -1.169478 -0.415938
[2,] -0.2929348 0.8842384 -1.380625 0.5558531 1.066137 -1.169478 -0.415938
        [,99]    [,100]
[1,] 1.558338 0.2880058
[2,] 1.558338 0.2880058
> 
> 
> Max(tmp2)
[1] 2.513811
> Min(tmp2)
[1] -4.042841
> mean(tmp2)
[1] -0.09009476
> Sum(tmp2)
[1] -9.009476
> Var(tmp2)
[1] 1.015195
> 
> rowMeans(tmp2)
  [1]  0.482102568  0.749327827  0.866695976 -1.841801283 -1.153002383
  [6]  0.606296565 -1.468945376 -0.091731072  0.167139242  0.269060955
 [11] -1.392388081 -2.351399702 -0.749349870 -0.121968055 -1.250275897
 [16] -0.538285104 -0.507799891 -0.313450289  0.994979964 -0.195286006
 [21]  1.210530314  0.428770479  0.922292712  0.883410421  0.307854380
 [26] -0.473388941  0.182659578 -1.035328863 -0.333893533  0.315964544
 [31]  1.303784742 -0.016619749  1.327330280 -0.041253151  0.222889072
 [36] -1.371200605 -0.278764866 -0.356153606  1.580289419 -0.451934411
 [41] -1.534769303 -0.030228334 -0.987152140 -1.293722327  0.723237886
 [46]  0.968211283 -0.293910337  1.249809795 -0.474682663  1.102011581
 [51] -0.668125853 -0.340262919  0.213289264 -0.253559309 -1.177672370
 [56] -1.312812591 -1.053834734  0.564110488  0.533828961 -1.595721378
 [61] -0.235844403 -0.229483596  0.925181789  0.462230385  0.010044733
 [66] -0.422734913 -0.443923993  0.968361689  0.574859707 -0.802980691
 [71]  1.980837378  0.322974772  0.853104349 -0.899715186 -0.746989828
 [76] -1.144504314 -1.354196043 -0.005963722 -0.379254524  0.557075213
 [81] -0.653715170 -0.217403186  1.364424189  0.132032107 -0.445252913
 [86] -1.989278273  1.126630998  1.179151416 -0.678249348 -0.442646169
 [91]  0.703882514  1.033810997 -0.293733694  0.535901934 -4.042841043
 [96]  2.513810993  0.496590128  1.066146057 -1.149394829 -0.063624572
> rowSums(tmp2)
  [1]  0.482102568  0.749327827  0.866695976 -1.841801283 -1.153002383
  [6]  0.606296565 -1.468945376 -0.091731072  0.167139242  0.269060955
 [11] -1.392388081 -2.351399702 -0.749349870 -0.121968055 -1.250275897
 [16] -0.538285104 -0.507799891 -0.313450289  0.994979964 -0.195286006
 [21]  1.210530314  0.428770479  0.922292712  0.883410421  0.307854380
 [26] -0.473388941  0.182659578 -1.035328863 -0.333893533  0.315964544
 [31]  1.303784742 -0.016619749  1.327330280 -0.041253151  0.222889072
 [36] -1.371200605 -0.278764866 -0.356153606  1.580289419 -0.451934411
 [41] -1.534769303 -0.030228334 -0.987152140 -1.293722327  0.723237886
 [46]  0.968211283 -0.293910337  1.249809795 -0.474682663  1.102011581
 [51] -0.668125853 -0.340262919  0.213289264 -0.253559309 -1.177672370
 [56] -1.312812591 -1.053834734  0.564110488  0.533828961 -1.595721378
 [61] -0.235844403 -0.229483596  0.925181789  0.462230385  0.010044733
 [66] -0.422734913 -0.443923993  0.968361689  0.574859707 -0.802980691
 [71]  1.980837378  0.322974772  0.853104349 -0.899715186 -0.746989828
 [76] -1.144504314 -1.354196043 -0.005963722 -0.379254524  0.557075213
 [81] -0.653715170 -0.217403186  1.364424189  0.132032107 -0.445252913
 [86] -1.989278273  1.126630998  1.179151416 -0.678249348 -0.442646169
 [91]  0.703882514  1.033810997 -0.293733694  0.535901934 -4.042841043
 [96]  2.513810993  0.496590128  1.066146057 -1.149394829 -0.063624572
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  0.482102568  0.749327827  0.866695976 -1.841801283 -1.153002383
  [6]  0.606296565 -1.468945376 -0.091731072  0.167139242  0.269060955
 [11] -1.392388081 -2.351399702 -0.749349870 -0.121968055 -1.250275897
 [16] -0.538285104 -0.507799891 -0.313450289  0.994979964 -0.195286006
 [21]  1.210530314  0.428770479  0.922292712  0.883410421  0.307854380
 [26] -0.473388941  0.182659578 -1.035328863 -0.333893533  0.315964544
 [31]  1.303784742 -0.016619749  1.327330280 -0.041253151  0.222889072
 [36] -1.371200605 -0.278764866 -0.356153606  1.580289419 -0.451934411
 [41] -1.534769303 -0.030228334 -0.987152140 -1.293722327  0.723237886
 [46]  0.968211283 -0.293910337  1.249809795 -0.474682663  1.102011581
 [51] -0.668125853 -0.340262919  0.213289264 -0.253559309 -1.177672370
 [56] -1.312812591 -1.053834734  0.564110488  0.533828961 -1.595721378
 [61] -0.235844403 -0.229483596  0.925181789  0.462230385  0.010044733
 [66] -0.422734913 -0.443923993  0.968361689  0.574859707 -0.802980691
 [71]  1.980837378  0.322974772  0.853104349 -0.899715186 -0.746989828
 [76] -1.144504314 -1.354196043 -0.005963722 -0.379254524  0.557075213
 [81] -0.653715170 -0.217403186  1.364424189  0.132032107 -0.445252913
 [86] -1.989278273  1.126630998  1.179151416 -0.678249348 -0.442646169
 [91]  0.703882514  1.033810997 -0.293733694  0.535901934 -4.042841043
 [96]  2.513810993  0.496590128  1.066146057 -1.149394829 -0.063624572
> rowMin(tmp2)
  [1]  0.482102568  0.749327827  0.866695976 -1.841801283 -1.153002383
  [6]  0.606296565 -1.468945376 -0.091731072  0.167139242  0.269060955
 [11] -1.392388081 -2.351399702 -0.749349870 -0.121968055 -1.250275897
 [16] -0.538285104 -0.507799891 -0.313450289  0.994979964 -0.195286006
 [21]  1.210530314  0.428770479  0.922292712  0.883410421  0.307854380
 [26] -0.473388941  0.182659578 -1.035328863 -0.333893533  0.315964544
 [31]  1.303784742 -0.016619749  1.327330280 -0.041253151  0.222889072
 [36] -1.371200605 -0.278764866 -0.356153606  1.580289419 -0.451934411
 [41] -1.534769303 -0.030228334 -0.987152140 -1.293722327  0.723237886
 [46]  0.968211283 -0.293910337  1.249809795 -0.474682663  1.102011581
 [51] -0.668125853 -0.340262919  0.213289264 -0.253559309 -1.177672370
 [56] -1.312812591 -1.053834734  0.564110488  0.533828961 -1.595721378
 [61] -0.235844403 -0.229483596  0.925181789  0.462230385  0.010044733
 [66] -0.422734913 -0.443923993  0.968361689  0.574859707 -0.802980691
 [71]  1.980837378  0.322974772  0.853104349 -0.899715186 -0.746989828
 [76] -1.144504314 -1.354196043 -0.005963722 -0.379254524  0.557075213
 [81] -0.653715170 -0.217403186  1.364424189  0.132032107 -0.445252913
 [86] -1.989278273  1.126630998  1.179151416 -0.678249348 -0.442646169
 [91]  0.703882514  1.033810997 -0.293733694  0.535901934 -4.042841043
 [96]  2.513810993  0.496590128  1.066146057 -1.149394829 -0.063624572
> 
> colMeans(tmp2)
[1] -0.09009476
> colSums(tmp2)
[1] -9.009476
> colVars(tmp2)
[1] 1.015195
> colSd(tmp2)
[1] 1.007569
> colMax(tmp2)
[1] 2.513811
> colMin(tmp2)
[1] -4.042841
> colMedians(tmp2)
[1] -0.1068496
> colRanges(tmp2)
          [,1]
[1,] -4.042841
[2,]  2.513811
> 
> 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]  4.6629548  2.7138631  0.7149977 -0.3075777 -2.2027163  6.1766679
 [7] -5.3075931 -0.9913235  5.8683875 -5.1117017
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.8728467
[2,] -0.1981744
[3,]  0.1988468
[4,]  1.4385694
[5,]  2.5829194
> 
> rowApply(tmp,sum)
 [1]  0.08172191 -1.44920821 -0.74572458  2.88519945  2.45563826 -2.86974738
 [7]  2.40797175  2.09917575 -1.36384971  2.71478142
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    7   10    4   10    4   10    9    4    2     4
 [2,]    9    7    3    6    7    8    1    6    7    10
 [3,]    2    9   10    7    5    2    6    7    9     1
 [4,]    6    5    1    5    3    5    7    8    6     8
 [5,]    8    6    5    1    9    7    3    2    3     3
 [6,]   10    1    9    8    8    6   10    1    5     9
 [7,]    3    3    2    2    1    1    8    3   10     2
 [8,]    1    4    7    3    2    9    4    9    8     5
 [9,]    4    8    8    9   10    4    5   10    4     7
[10,]    5    2    6    4    6    3    2    5    1     6
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.00508344  7.62081988 -1.52017926  4.37129956  5.64987604  2.93515150
 [7] -6.83578546 -1.59580441 -2.73949027  1.96211664 -3.90843847 -0.46205862
[13] -2.98969800 -2.74384211 -0.09623975 -1.16142374  5.19484627 -2.49692124
[19] -5.83747906 -0.74657822
> colApply(tmp,quantile)[,1]
             [,1]
[1,] -0.216038935
[2,] -0.145836668
[3,]  0.003736741
[4,]  0.410380917
[5,]  1.952841389
> 
> rowApply(tmp,sum)
[1]  7.337229 -3.502710 -3.914205  4.249009 -7.564068
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   18   10   11   11   13
[2,]   19   13   19   20   20
[3,]   17    8    2   10    4
[4,]   10   20   15   14   18
[5,]   20   18   17   18   12
> 
> 
> as.matrix(tmp)
             [,1]      [,2]       [,3]      [,4]       [,5]      [,6]      [,7]
[1,]  1.952841389 1.9540801  1.9253222 0.2198529  2.0498232 1.1831230 -1.560302
[2,] -0.216038935 0.1882223 -0.2446210 2.1896738  1.2374455 0.3081985 -1.370933
[3,] -0.145836668 1.7683224 -1.9102302 0.5075494  1.0150453 1.1017687 -1.063481
[4,]  0.410380917 1.8988264  0.2331405 0.6046731  1.5317024 0.1861345 -1.465469
[5,]  0.003736741 1.8113687 -1.5237908 0.8495504 -0.1841403 0.1559268 -1.375601
            [,8]       [,9]      [,10]      [,11]      [,12]      [,13]
[1,] -1.25061123 -1.5542178  0.1959337 -1.3683326 -0.6586510  1.2287775
[2,] -0.16468398  0.6252824  1.4505025 -0.2173373 -1.3725957 -0.9385704
[3,]  0.45017457 -0.1549494  1.9786279 -1.8334878 -0.9623699 -1.4647882
[4,]  0.04725855 -0.6517660 -1.0504363  1.3175552  1.3390932  0.4109845
[5,] -0.67794233 -1.0038394 -0.6125111 -1.8068360  1.1924648 -2.2261013
          [,14]      [,15]      [,16]     [,17]      [,18]      [,19]
[1,]  1.0255490  0.5807333  0.1242611 1.5495240  0.4047707 -0.3774271
[2,] -1.7145035  0.8392016 -0.8773532 0.6729703 -3.4073599 -0.4081446
[3,] -2.6832598  0.3606067 -0.4962680 0.7996540 -0.4617014 -0.7940526
[4,]  0.4268137 -1.2681628 -0.4495655 1.6026648  1.3000562 -2.3962174
[5,]  0.2015584 -0.6086185  0.5375018 0.5700331 -0.3326869 -1.8616374
           [,20]
[1,] -0.28782196
[2,] -0.08206572
[3,]  0.07447144
[4,]  0.22134245
[5,] -0.67250442
> 
> 
> 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.22-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.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  653  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  565  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
           col1      col2      col3    col4       col5      col6       col7
row1 -0.3043873 -1.334932 0.6660398 1.68123 -0.7732232 -1.316848 -0.3745571
            col8      col9    col10     col11      col12      col13      col14
row1 -0.02091469 0.5853776 0.211821 -2.607546 -0.2710588 0.05887356 -0.8469448
         col15      col16      col17     col18     col19    col20
row1 0.8995367 -0.6395755 0.08596008 -1.402897 0.6093068 1.393753
> tmp[,"col10"]
          col10
row1  0.2118210
row2 -1.9948732
row3  0.0168371
row4  0.7046839
row5 -1.6128022
> tmp[c("row1","row5"),]
           col1      col2      col3       col4       col5      col6        col7
row1 -0.3043873 -1.334932 0.6660398  1.6812302 -0.7732232 -1.316848 -0.37455714
row5 -1.2821451 -1.250864 0.1859656 -0.9450326 -0.5924678  1.857557 -0.04351933
            col8      col9     col10      col11      col12       col13
row1 -0.02091469 0.5853776  0.211821 -2.6075457 -0.2710588  0.05887356
row5  0.13473700 0.7843737 -1.612802  0.6507923  1.2655718 -0.64020517
          col14      col15      col16      col17       col18      col19
row1 -0.8469448  0.8995367 -0.6395755 0.08596008 -1.40289673  0.6093068
row5  1.3218028 -1.1055187 -1.6706651 1.42486949  0.04796551 -0.6227180
          col20
row1  1.3937530
row5 -0.3747855
> tmp[,c("col6","col20")]
            col6      col20
row1 -1.31684844  1.3937530
row2  0.06586562  0.4312663
row3  0.24151478 -1.0531399
row4  0.05719229 -0.4527370
row5  1.85755746 -0.3747855
> tmp[c("row1","row5"),c("col6","col20")]
          col6      col20
row1 -1.316848  1.3937530
row5  1.857557 -0.3747855
> 
> 
> 
> 
> 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.20052 49.99118 48.79073 48.90104 49.45998 106.2845 49.01356 48.18807
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.16989 50.59853 49.68687 50.29499 49.98029 48.67467 48.67926 49.64301
        col17    col18    col19    col20
row1 50.98742 50.24535 47.42413 106.3829
> tmp[,"col10"]
        col10
row1 50.59853
row2 29.46745
row3 30.79452
row4 29.77642
row5 49.66507
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.20052 49.99118 48.79073 48.90104 49.45998 106.2845 49.01356 48.18807
row5 49.51770 51.07991 50.35022 49.78513 50.46955 105.7837 49.69203 50.98364
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.16989 50.59853 49.68687 50.29499 49.98029 48.67467 48.67926 49.64301
row5 51.24073 49.66507 51.14442 49.01151 51.73423 49.54047 49.55726 49.89353
        col17    col18    col19    col20
row1 50.98742 50.24535 47.42413 106.3829
row5 51.65646 48.27079 50.92060 105.3643
> tmp[,c("col6","col20")]
          col6     col20
row1 106.28450 106.38290
row2  73.06389  74.44819
row3  75.29637  75.01557
row4  76.25533  75.63789
row5 105.78369 105.36426
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 106.2845 106.3829
row5 105.7837 105.3643
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 106.2845 106.3829
row5 105.7837 105.3643
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.7479779
[2,]  0.4829316
[3,]  0.2084980
[4,] -0.4875892
[5,]  2.1052821
> tmp[,c("col17","col7")]
         col17       col7
[1,] 0.7039851 -0.1569735
[2,] 0.9012747  1.3974318
[3,] 0.3408802 -1.1181340
[4,] 1.3906318 -1.5893140
[5,] 0.4808993  0.1503184
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,] -0.46399626 -1.1106173
[2,]  1.52941036 -0.2657023
[3,] -1.00517549  1.3899299
[4,]  0.08435591  1.5980192
[5,] -1.23191642 -0.1403423
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.4639963
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.4639963
[2,]  1.5294104
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]       [,2]      [,3]      [,4]       [,5]        [,6]       [,7]
row3 0.5337032 -0.1880530 0.7596667 1.2227998 -1.0622789  0.03117577  1.6877258
row1 0.3371550 -0.7438858 2.6489604 0.2981472 -0.3742896 -1.61983291 -0.7584783
          [,8]        [,9]      [,10]      [,11]      [,12]      [,13]
row3 0.8423986  0.03423466  0.3733180 -0.7229829  0.9996712 -1.0742354
row1 1.1454992 -0.30978635 -0.5183179 -0.2351878 -0.4818615  0.8071444
         [,14]      [,15]      [,16]      [,17]      [,18]      [,19]
row3 0.4394434  0.6952953 -0.1219739 -0.3289399 -0.8893987 -0.2115453
row1 0.8641308 -0.1370216  0.4018527  0.1426364 -0.4991990 -2.2263744
          [,20]
row3  0.7566758
row1 -0.8934756
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]       [,2]       [,3]     [,4]       [,5]     [,6]      [,7]
row2 0.4359666 -0.2867847 -0.3047107 2.126442 -0.8083161 0.584292 0.8468217
        [,8]       [,9]    [,10]
row2 3.51219 -0.8063109 1.186892
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]     [,2]      [,3]       [,4]       [,5]      [,6]     [,7]
row5 0.8957848 1.515053 -1.471067 -0.8242493 -0.5646122 -0.169654 1.270152
           [,8]       [,9]    [,10]      [,11]    [,12]     [,13]     [,14]
row5 -0.7234722 -0.7401678 1.255313 -0.8102007 0.239956 0.4777824 0.7457342
         [,15]     [,16]      [,17]      [,18]     [,19]   [,20]
row5 -1.301325 0.3656465 -0.0458851 0.02139407 0.3299842 1.01913
> 
> 
> 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: 0x557b9f2e08a0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1297023a02594e"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM12970257897d70"
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM12970233b002a2"
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM129702d16deb3" 
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1297027f311c0d"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM12970214880a02"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM129702768d0d9a"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM12970244b1bf84"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1297025cac120f"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM129702791a37f9"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM12970272b3d182"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM129702600094"  
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM12970271642e7c"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1297023db205a9"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1297027aa3c65e"
> 
> 
> ### 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: 0x557b9dc77510>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x557b9dc77510>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x557b9dc77510>
> rowMedians(tmp)
  [1] -0.225383864  0.819703560  0.387842382 -0.346102571 -0.061956981
  [6]  0.055671654 -0.003133766  0.226235479  0.243474806  0.349009862
 [11]  0.195569658  0.233460285 -0.575597349 -0.170269813  0.079647099
 [16] -0.633278378 -0.124122128  0.477795380  0.166059458  0.197541738
 [21]  0.006065931 -0.515411495  0.401354570 -0.062849526 -0.299359616
 [26] -0.305354344 -0.557672951  0.028642755  0.291408866  0.017747746
 [31]  0.177468371 -0.201317175  0.446739779 -0.197708345 -0.376569857
 [36] -0.696998326  0.318914979  0.210975486  0.272398708 -0.325662996
 [41] -0.243002566  0.247461181 -0.276204388 -0.089312987 -0.211356092
 [46] -0.440518007 -0.706727469  0.255103009  0.327287580 -0.230703696
 [51]  0.241460254 -0.144227380 -0.451130204  0.086854318  0.205046030
 [56] -0.351257616 -0.107266305  0.147900423 -0.314078747  0.052605340
 [61] -0.643983038  0.551141789  0.614152984 -0.237506906 -0.776708750
 [66] -0.072594027 -0.455104773 -0.584328828  0.357613895  0.189868009
 [71] -0.249410876 -0.344010045  0.201821853 -0.038444872  0.201213214
 [76]  0.207255980  0.155301898 -0.037878239  0.517740296 -0.467142632
 [81]  0.393844132 -0.494663709 -0.003258079  0.418426829  0.272536357
 [86]  0.404763564 -0.100740878  0.443053449 -0.528556313 -0.094406497
 [91] -0.532570024 -0.436495747  0.484808132  0.058992324  0.265208050
 [96]  0.452882236  0.189941773  0.238839668 -0.264809587  0.098246501
[101]  0.444810112 -0.045907997  0.121764513  0.282923770  0.231604108
[106] -0.363078570 -0.490501147  0.547428553  0.720794353 -0.331240371
[111]  0.448680200 -0.134195936  0.028848792 -0.157039912  0.575422731
[116] -0.176378155  0.383002717 -0.437022123  0.337838682  0.600872539
[121]  0.449434776 -0.056347406 -0.319884392  0.174644136 -0.460563216
[126]  0.152412747 -0.194306932 -0.051801556 -0.021056696 -0.185142170
[131]  0.385248131  0.171403324 -0.301128484  0.430799404 -0.021734036
[136]  0.138825361 -0.477246981  0.462088408  0.516374106 -0.497739179
[141] -0.296683830 -0.082185944  0.209511729 -0.167780690 -0.423385849
[146]  0.364642445 -0.377850019  0.357780374 -0.532784671 -0.333533511
[151] -0.035428123  0.382551874 -0.234349693 -0.205853557  0.154345647
[156]  0.458008885 -0.398102908  0.148352064  0.229292295  0.142705680
[161] -0.748015347 -0.015690916  0.316248441 -0.479269133 -0.103503236
[166]  0.198223556  0.438744079 -0.761034162  0.784010587  0.085331257
[171]  0.232547480 -0.162124038  0.029397391 -0.592360644 -0.114274823
[176] -0.109163057 -0.211201185  0.052004400 -0.255570113 -0.546520104
[181]  0.137892172  0.251760813 -0.119030657 -0.075204590 -0.069383667
[186] -0.288514987  0.334927223  0.144193658 -0.123249565  0.011249880
[191] -0.181894703  0.424574322  0.144554887 -0.250515096  0.237998661
[196]  0.842176208 -0.450084592 -0.582984934 -0.166622099 -0.341034804
[201]  0.408783014 -0.554616675 -0.296663024  0.319328300 -0.306510871
[206]  0.426037758 -0.137853598  0.711497019 -0.250642291 -0.299799180
[211] -0.318532959  0.097001783 -0.314888996  0.407366407  0.021385760
[216]  0.574940309 -0.340693146  0.161005963 -0.370899204 -0.269696754
[221] -0.075422598 -0.121891873  0.011915028  0.005855864 -0.724787662
[226] -0.414588775  0.395368458 -0.121610450  0.399674388  0.165393117
> 
> proc.time()
   user  system elapsed 
  1.275   0.672   1.936 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root"
Copyright (C) 2025 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: 0x5c2cc9d66b10>
> .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: 0x5c2cc9d66b10>
> .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: 0x5c2cc9d66b10>
> .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: 0x5c2cc9d66b10>
> 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: 0x5c2cc8a18660>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c2cc8a18660>
> .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: 0x5c2cc8a18660>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c2cc8a18660>
> .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: 0x5c2cc8a18660>
> 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: 0x5c2cc85f9c40>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c2cc85f9c40>
> .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: 0x5c2cc85f9c40>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5c2cc85f9c40>
> .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: 0x5c2cc85f9c40>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x5c2cc85f9c40>
> .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: 0x5c2cc85f9c40>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x5c2cc85f9c40>
> .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: 0x5c2cc85f9c40>
> 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: 0x5c2ccb0e54f0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5c2ccb0e54f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c2ccb0e54f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c2ccb0e54f0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1297ba1925cd05" "BufferedMatrixFile1297ba3fc78df2"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1297ba1925cd05" "BufferedMatrixFile1297ba3fc78df2"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c2ccaa23a80>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c2ccaa23a80>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5c2ccaa23a80>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5c2ccaa23a80>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5c2ccaa23a80>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5c2ccaa23a80>
> .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: 0x5c2cca900750>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c2cca900750>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5c2cca900750>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5c2cca900750>
> 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: 0x5c2cc8970fc0>
> .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: 0x5c2cc8970fc0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.267   0.055   0.307 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root"
Copyright (C) 2025 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.242   0.049   0.279 

Example timings