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

This page was generated on 2026-01-01 11:58 -0500 (Thu, 01 Jan 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.2 (2025-10-31) -- "[Not] Part in a Rumble" 4883
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4671
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-12-29 13:45 -0500 (Mon, 29 Dec 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 taishan

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.
- See Martin Grigorov's blog post for how to debug Linux ARM64 related issues on a x86_64 host.

raw results


Summary

Package: BufferedMatrix
Version: 1.74.0
Command: /home/biocbuild/R/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/R/R/site-library --no-vignettes --timings BufferedMatrix_1.74.0.tar.gz
StartedAt: 2025-12-30 09:00:03 -0000 (Tue, 30 Dec 2025)
EndedAt: 2025-12-30 09:00:32 -0000 (Tue, 30 Dec 2025)
EllapsedTime: 29.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.0 (2025-04-11)
* using platform: aarch64-unknown-linux-gnu
* R was compiled by
    aarch64-unknown-linux-gnu-gcc (GCC) 14.2.0
    GNU Fortran (GCC) 14.2.0
* running under: openEuler 24.03 (LTS)
* using session charset: UTF-8
* using option ‘--no-vignettes’
* 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: ‘aarch64-unknown-linux-gnu-gcc (GCC) 14.2.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 running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* 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/R/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library ‘/home/biocbuild/R/R-4.5.0/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.0’
** using staged installation
** libs
using C compiler: ‘aarch64-unknown-linux-gnu-gcc (GCC) 14.2.0’
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R-4.5.0/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R-4.5.0/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){
      |            ^~~~~~~~~~~
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R-4.5.0/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R-4.5.0/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -Werror=format-security -c init_package.c -o init_package.o
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -shared -L/home/biocbuild/R/R-4.5.0/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/R/R-4.5.0/lib -lR
installing to /home/biocbuild/R/R-4.5.0/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.0 (2025-04-11) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-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.335   0.029   0.350 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-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 478398 25.6    1047041   56   639620 34.2
Vcells 885166  6.8    8388608   64  2080985 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue Dec 30 09:00:27 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] "Tue Dec 30 09:00:27 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: 0xfb48ff0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue Dec 30 09:00:27 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] "Tue Dec 30 09:00:27 2025"
> 
> ColMode(tmp2)
<pointer: 0xfb48ff0>
> 
> 
> 
> ### 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.2928445  0.22847568  0.5840600 -1.2839226
[2,]   0.5034144 -0.89343748  0.9393734  0.9550614
[3,]  -1.2172819 -0.80021082  0.3537694 -0.1151632
[4,]   0.8045501 -0.04405633 -1.1154515  1.2279528
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]       [,2]      [,3]      [,4]
[1,] 100.2928445 0.22847568 0.5840600 1.2839226
[2,]   0.5034144 0.89343748 0.9393734 0.9550614
[3,]   1.2172819 0.80021082 0.3537694 0.1151632
[4,]   0.8045501 0.04405633 1.1154515 1.2279528
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0146315 0.4779913 0.7642382 1.1331031
[2,]  0.7095170 0.9452182 0.9692128 0.9772725
[3,]  1.1033050 0.8945450 0.5947852 0.3393571
[4,]  0.8969672 0.2098960 1.0561494 1.1081303
> 
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.43916 30.00839 33.22644 37.61495
[2,]  32.59858 35.34562 35.63150 35.72779
[3,]  37.25033 34.74566 31.30162 28.50873
[4,]  34.77422 27.14302 36.67695 37.30926
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0xe82b6c0>
> exp(tmp5)
<pointer: 0xe82b6c0>
> log(tmp5,2)
<pointer: 0xe82b6c0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.2221
> Min(tmp5)
[1] 52.58092
> mean(tmp5)
[1] 72.52231
> Sum(tmp5)
[1] 14504.46
> Var(tmp5)
[1] 864.6242
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.72212 69.14627 67.63177 71.36113 71.87590 72.55954 71.95200 68.82918
 [9] 69.19225 71.95294
> rowSums(tmp5)
 [1] 1814.442 1382.925 1352.635 1427.223 1437.518 1451.191 1439.040 1376.584
 [9] 1383.845 1439.059
> rowVars(tmp5)
 [1] 8013.10251   33.12335   88.01251   49.21381  109.62125   99.89649
 [7]   54.63234   55.12019   77.56607   61.09827
> rowSd(tmp5)
 [1] 89.515934  5.755289  9.381499  7.015255 10.470017  9.994823  7.391369
 [8]  7.424298  8.807160  7.816538
> rowMax(tmp5)
 [1] 469.22207  81.42224  80.38018  81.63478  95.78084  88.40061  89.30328
 [8]  86.31748  88.71141  85.20387
> rowMin(tmp5)
 [1] 56.96644 58.08829 52.58092 56.49463 55.01190 55.10450 58.69443 55.53874
 [9] 55.95298 57.63078
> 
> colMeans(tmp5)
 [1] 117.57285  70.88997  71.01478  70.05532  66.00020  72.05605  68.98571
 [8]  68.71573  73.31011  67.11115  71.87044  71.84411  67.23595  70.33891
[15]  69.35920  69.06970  70.62622  70.00729  71.14182  73.24068
> colSums(tmp5)
 [1] 1175.7285  708.8997  710.1478  700.5532  660.0020  720.5605  689.8571
 [8]  687.1573  733.1011  671.1115  718.7044  718.4411  672.3595  703.3891
[15]  693.5920  690.6970  706.2622  700.0729  711.4182  732.4068
> colVars(tmp5)
 [1] 15333.63609    63.95686    19.41159    65.74688    55.94613    93.33403
 [7]    69.07837    53.52070   162.80355    99.70968    45.21561    48.72134
[13]    49.37300    87.97596   114.52174    28.50226    62.34270    64.76243
[19]    67.76787    78.03740
> colSd(tmp5)
 [1] 123.829060   7.997303   4.405858   8.108445   7.479715   9.660954
 [7]   8.311340   7.315785  12.759449   9.985474   6.724255   6.980067
[13]   7.026592   9.379550  10.701483   5.338751   7.895740   8.047511
[19]   8.232124   8.833878
> colMax(tmp5)
 [1] 469.22207  86.94047  77.74338  78.29060  78.79620  95.44749  78.50201
 [8]  79.83907  89.30328  83.81080  80.98352  81.66167  80.23727  81.42224
[15]  87.18237  75.32785  85.20387  80.22414  86.31748  88.71141
> colMin(tmp5)
 [1] 67.84968 56.49463 65.15022 57.99942 56.50041 58.79383 55.95298 53.65054
 [9] 55.53874 52.58092 61.77068 59.10162 59.74671 55.01190 56.96644 60.39909
[17] 61.46240 55.01958 58.14643 62.22334
> 
> 
> ### 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.72212 69.14627 67.63177 71.36113 71.87590 72.55954 71.95200 68.82918
 [9] 69.19225       NA
> rowSums(tmp5)
 [1] 1814.442 1382.925 1352.635 1427.223 1437.518 1451.191 1439.040 1376.584
 [9] 1383.845       NA
> rowVars(tmp5)
 [1] 8013.10251   33.12335   88.01251   49.21381  109.62125   99.89649
 [7]   54.63234   55.12019   77.56607   64.22756
> rowSd(tmp5)
 [1] 89.515934  5.755289  9.381499  7.015255 10.470017  9.994823  7.391369
 [8]  7.424298  8.807160  8.014210
> rowMax(tmp5)
 [1] 469.22207  81.42224  80.38018  81.63478  95.78084  88.40061  89.30328
 [8]  86.31748  88.71141        NA
> rowMin(tmp5)
 [1] 56.96644 58.08829 52.58092 56.49463 55.01190 55.10450 58.69443 55.53874
 [9] 55.95298       NA
> 
> colMeans(tmp5)
 [1] 117.57285  70.88997  71.01478  70.05532  66.00020  72.05605  68.98571
 [8]  68.71573  73.31011        NA  71.87044  71.84411  67.23595  70.33891
[15]  69.35920  69.06970  70.62622  70.00729  71.14182  73.24068
> colSums(tmp5)
 [1] 1175.7285  708.8997  710.1478  700.5532  660.0020  720.5605  689.8571
 [8]  687.1573  733.1011        NA  718.7044  718.4411  672.3595  703.3891
[15]  693.5920  690.6970  706.2622  700.0729  711.4182  732.4068
> colVars(tmp5)
 [1] 15333.63609    63.95686    19.41159    65.74688    55.94613    93.33403
 [7]    69.07837    53.52070   162.80355          NA    45.21561    48.72134
[13]    49.37300    87.97596   114.52174    28.50226    62.34270    64.76243
[19]    67.76787    78.03740
> colSd(tmp5)
 [1] 123.829060   7.997303   4.405858   8.108445   7.479715   9.660954
 [7]   8.311340   7.315785  12.759449         NA   6.724255   6.980067
[13]   7.026592   9.379550  10.701483   5.338751   7.895740   8.047511
[19]   8.232124   8.833878
> colMax(tmp5)
 [1] 469.22207  86.94047  77.74338  78.29060  78.79620  95.44749  78.50201
 [8]  79.83907  89.30328        NA  80.98352  81.66167  80.23727  81.42224
[15]  87.18237  75.32785  85.20387  80.22414  86.31748  88.71141
> colMin(tmp5)
 [1] 67.84968 56.49463 65.15022 57.99942 56.50041 58.79383 55.95298 53.65054
 [9] 55.53874       NA 61.77068 59.10162 59.74671 55.01190 56.96644 60.39909
[17] 61.46240 55.01958 58.14643 62.22334
> 
> Max(tmp5,na.rm=TRUE)
[1] 469.2221
> Min(tmp5,na.rm=TRUE)
[1] 52.58092
> mean(tmp5,na.rm=TRUE)
[1] 72.53587
> Sum(tmp5,na.rm=TRUE)
[1] 14434.64
> Var(tmp5,na.rm=TRUE)
[1] 868.9541
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.72212 69.14627 67.63177 71.36113 71.87590 72.55954 71.95200 68.82918
 [9] 69.19225 72.06499
> rowSums(tmp5,na.rm=TRUE)
 [1] 1814.442 1382.925 1352.635 1427.223 1437.518 1451.191 1439.040 1376.584
 [9] 1383.845 1369.235
> rowVars(tmp5,na.rm=TRUE)
 [1] 8013.10251   33.12335   88.01251   49.21381  109.62125   99.89649
 [7]   54.63234   55.12019   77.56607   64.22756
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.515934  5.755289  9.381499  7.015255 10.470017  9.994823  7.391369
 [8]  7.424298  8.807160  8.014210
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.22207  81.42224  80.38018  81.63478  95.78084  88.40061  89.30328
 [8]  86.31748  88.71141  85.20387
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.96644 58.08829 52.58092 56.49463 55.01190 55.10450 58.69443 55.53874
 [9] 55.95298 57.63078
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 117.57285  70.88997  71.01478  70.05532  66.00020  72.05605  68.98571
 [8]  68.71573  73.31011  66.80973  71.87044  71.84411  67.23595  70.33891
[15]  69.35920  69.06970  70.62622  70.00729  71.14182  73.24068
> colSums(tmp5,na.rm=TRUE)
 [1] 1175.7285  708.8997  710.1478  700.5532  660.0020  720.5605  689.8571
 [8]  687.1573  733.1011  601.2875  718.7044  718.4411  672.3595  703.3891
[15]  693.5920  690.6970  706.2622  700.0729  711.4182  732.4068
> colVars(tmp5,na.rm=TRUE)
 [1] 15333.63609    63.95686    19.41159    65.74688    55.94613    93.33403
 [7]    69.07837    53.52070   162.80355   111.15126    45.21561    48.72134
[13]    49.37300    87.97596   114.52174    28.50226    62.34270    64.76243
[19]    67.76787    78.03740
> colSd(tmp5,na.rm=TRUE)
 [1] 123.829060   7.997303   4.405858   8.108445   7.479715   9.660954
 [7]   8.311340   7.315785  12.759449  10.542830   6.724255   6.980067
[13]   7.026592   9.379550  10.701483   5.338751   7.895740   8.047511
[19]   8.232124   8.833878
> colMax(tmp5,na.rm=TRUE)
 [1] 469.22207  86.94047  77.74338  78.29060  78.79620  95.44749  78.50201
 [8]  79.83907  89.30328  83.81080  80.98352  81.66167  80.23727  81.42224
[15]  87.18237  75.32785  85.20387  80.22414  86.31748  88.71141
> colMin(tmp5,na.rm=TRUE)
 [1] 67.84968 56.49463 65.15022 57.99942 56.50041 58.79383 55.95298 53.65054
 [9] 55.53874 52.58092 61.77068 59.10162 59.74671 55.01190 56.96644 60.39909
[17] 61.46240 55.01958 58.14643 62.22334
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.72212 69.14627 67.63177 71.36113 71.87590 72.55954 71.95200 68.82918
 [9] 69.19225      NaN
> rowSums(tmp5,na.rm=TRUE)
 [1] 1814.442 1382.925 1352.635 1427.223 1437.518 1451.191 1439.040 1376.584
 [9] 1383.845    0.000
> rowVars(tmp5,na.rm=TRUE)
 [1] 8013.10251   33.12335   88.01251   49.21381  109.62125   99.89649
 [7]   54.63234   55.12019   77.56607         NA
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.515934  5.755289  9.381499  7.015255 10.470017  9.994823  7.391369
 [8]  7.424298  8.807160        NA
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.22207  81.42224  80.38018  81.63478  95.78084  88.40061  89.30328
 [8]  86.31748  88.71141        NA
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.96644 58.08829 52.58092 56.49463 55.01190 55.10450 58.69443 55.53874
 [9] 55.95298       NA
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 121.39410  71.14300  71.23694  69.86215  64.57842  72.75090  70.24737
 [8]  69.02200  72.08912       NaN  72.99263  70.79599  67.82013  69.79147
[15]  68.82567  69.12858  69.00648  69.47213  71.61449  73.13018
> colSums(tmp5,na.rm=TRUE)
 [1] 1092.5469  640.2870  641.1324  628.7593  581.2058  654.7581  632.2263
 [8]  621.1980  648.8021    0.0000  656.9337  637.1639  610.3812  628.1232
[15]  619.4310  622.1573  621.0583  625.2491  644.5304  658.1716
> colVars(tmp5,na.rm=TRUE)
 [1] 17086.06861    71.23118    21.28282    73.54542    40.19804    99.56912
 [7]    59.80559    59.15556   166.38224          NA    36.70017    42.45274
[13]    51.70542    95.60136   125.63458    32.02604    40.62054    69.63577
[19]    73.72539    87.65471
> colSd(tmp5,na.rm=TRUE)
 [1] 130.713689   8.439857   4.613331   8.575863   6.340193   9.978433
 [7]   7.733408   7.691265  12.898924         NA   6.058066   6.515577
[13]   7.190648   9.777595  11.208683   5.659155   6.373424   8.344805
[19]   8.586349   9.362410
> colMax(tmp5,na.rm=TRUE)
 [1] 469.22207  86.94047  77.74338  78.29060  74.66098  95.44749  78.50201
 [8]  79.83907  89.30328      -Inf  80.98352  81.66167  80.23727  81.42224
[15]  87.18237  75.32785  79.21198  80.22414  86.31748  88.71141
> colMin(tmp5,na.rm=TRUE)
 [1] 67.84968 56.49463 65.15022 57.99942 56.50041 58.79383 55.95298 53.65054
 [9] 55.53874      Inf 67.17125 59.10162 59.74671 55.01190 56.96644 60.39909
[17] 61.46240 55.01958 58.14643 62.22334
> 
> 
> 
> 
> 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] 222.2478 176.0371 271.5903 292.2299 125.2628 272.9191 348.4339 244.2571
 [9] 191.8361 235.7089
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 222.2478 176.0371 271.5903 292.2299 125.2628 272.9191 348.4339 244.2571
 [9] 191.8361 235.7089
> 
> 
> 
> 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]  5.684342e-14  8.526513e-14  1.421085e-13 -5.684342e-14  0.000000e+00
 [6] -1.136868e-13 -5.684342e-14 -1.136868e-13  0.000000e+00  1.705303e-13
[11]  5.684342e-14 -4.263256e-14 -1.705303e-13 -2.273737e-13 -8.526513e-14
[16] -8.526513e-14 -9.947598e-14  8.526513e-14 -5.684342e-14 -1.705303e-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)
+ }
8   15 
4   6 
1   14 
1   4 
7   3 
10   9 
8   14 
1   19 
2   13 
8   19 
8   17 
3   3 
10   14 
10   14 
5   16 
8   20 
5   2 
10   8 
1   6 
7   19 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 3.235552
> Min(tmp)
[1] -2.970902
> mean(tmp)
[1] -0.03909204
> Sum(tmp)
[1] -3.909204
> Var(tmp)
[1] 1.032889
> 
> rowMeans(tmp)
[1] -0.03909204
> rowSums(tmp)
[1] -3.909204
> rowVars(tmp)
[1] 1.032889
> rowSd(tmp)
[1] 1.016311
> rowMax(tmp)
[1] 3.235552
> rowMin(tmp)
[1] -2.970902
> 
> colMeans(tmp)
  [1] -0.076980842 -0.464611164  0.718288233  1.609546669 -0.996194766
  [6]  0.830421028  0.669183714 -0.296228223  3.235552382 -0.952010562
 [11] -1.503887994  0.904753665  0.794457408 -0.580242892 -0.198718721
 [16]  1.774983729 -0.908421271  0.116776901  0.272552411  0.121665718
 [21] -0.315664785 -2.970901595  0.896611934  0.905944456 -1.305136179
 [26] -0.015003454 -0.207092051 -1.214274694 -0.120187559  0.779149122
 [31] -1.398236994 -1.190848589  0.082644244 -0.953048063  1.150961350
 [36]  1.367438194  0.790062244 -0.379444783 -0.914588919 -2.802116395
 [41] -0.053040832 -0.576024220 -0.586534102  0.917651416  0.460344864
 [46]  1.889227772  0.195480609  0.735958443  0.500638583  1.820382278
 [51] -0.325935563  0.648878173  0.115965681  0.307062525 -0.219318268
 [56] -0.133565337  0.985682565  0.112718364 -0.926460061 -0.626084242
 [61] -1.972924550  0.309761614  0.270114392  1.146997614 -0.522125863
 [66]  0.298065699 -1.168599816 -1.004038931  0.634028238 -0.790892756
 [71]  1.791401959 -1.784025735  0.031438586  0.516542527 -0.060512316
 [76] -1.473930701  0.416587078 -0.289127626 -1.033687764 -0.390572097
 [81] -0.006761801 -0.171008043  0.075118640 -2.071071470 -1.092287164
 [86]  1.395999925 -1.740745578 -0.185260501  0.973234147  0.973712448
 [91] -0.024294893  0.313279777 -0.557909478 -0.471947701  0.078976809
 [96] -0.082346547  0.658114410  0.522516485  0.471208790 -0.392413460
> colSums(tmp)
  [1] -0.076980842 -0.464611164  0.718288233  1.609546669 -0.996194766
  [6]  0.830421028  0.669183714 -0.296228223  3.235552382 -0.952010562
 [11] -1.503887994  0.904753665  0.794457408 -0.580242892 -0.198718721
 [16]  1.774983729 -0.908421271  0.116776901  0.272552411  0.121665718
 [21] -0.315664785 -2.970901595  0.896611934  0.905944456 -1.305136179
 [26] -0.015003454 -0.207092051 -1.214274694 -0.120187559  0.779149122
 [31] -1.398236994 -1.190848589  0.082644244 -0.953048063  1.150961350
 [36]  1.367438194  0.790062244 -0.379444783 -0.914588919 -2.802116395
 [41] -0.053040832 -0.576024220 -0.586534102  0.917651416  0.460344864
 [46]  1.889227772  0.195480609  0.735958443  0.500638583  1.820382278
 [51] -0.325935563  0.648878173  0.115965681  0.307062525 -0.219318268
 [56] -0.133565337  0.985682565  0.112718364 -0.926460061 -0.626084242
 [61] -1.972924550  0.309761614  0.270114392  1.146997614 -0.522125863
 [66]  0.298065699 -1.168599816 -1.004038931  0.634028238 -0.790892756
 [71]  1.791401959 -1.784025735  0.031438586  0.516542527 -0.060512316
 [76] -1.473930701  0.416587078 -0.289127626 -1.033687764 -0.390572097
 [81] -0.006761801 -0.171008043  0.075118640 -2.071071470 -1.092287164
 [86]  1.395999925 -1.740745578 -0.185260501  0.973234147  0.973712448
 [91] -0.024294893  0.313279777 -0.557909478 -0.471947701  0.078976809
 [96] -0.082346547  0.658114410  0.522516485  0.471208790 -0.392413460
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -0.076980842 -0.464611164  0.718288233  1.609546669 -0.996194766
  [6]  0.830421028  0.669183714 -0.296228223  3.235552382 -0.952010562
 [11] -1.503887994  0.904753665  0.794457408 -0.580242892 -0.198718721
 [16]  1.774983729 -0.908421271  0.116776901  0.272552411  0.121665718
 [21] -0.315664785 -2.970901595  0.896611934  0.905944456 -1.305136179
 [26] -0.015003454 -0.207092051 -1.214274694 -0.120187559  0.779149122
 [31] -1.398236994 -1.190848589  0.082644244 -0.953048063  1.150961350
 [36]  1.367438194  0.790062244 -0.379444783 -0.914588919 -2.802116395
 [41] -0.053040832 -0.576024220 -0.586534102  0.917651416  0.460344864
 [46]  1.889227772  0.195480609  0.735958443  0.500638583  1.820382278
 [51] -0.325935563  0.648878173  0.115965681  0.307062525 -0.219318268
 [56] -0.133565337  0.985682565  0.112718364 -0.926460061 -0.626084242
 [61] -1.972924550  0.309761614  0.270114392  1.146997614 -0.522125863
 [66]  0.298065699 -1.168599816 -1.004038931  0.634028238 -0.790892756
 [71]  1.791401959 -1.784025735  0.031438586  0.516542527 -0.060512316
 [76] -1.473930701  0.416587078 -0.289127626 -1.033687764 -0.390572097
 [81] -0.006761801 -0.171008043  0.075118640 -2.071071470 -1.092287164
 [86]  1.395999925 -1.740745578 -0.185260501  0.973234147  0.973712448
 [91] -0.024294893  0.313279777 -0.557909478 -0.471947701  0.078976809
 [96] -0.082346547  0.658114410  0.522516485  0.471208790 -0.392413460
> colMin(tmp)
  [1] -0.076980842 -0.464611164  0.718288233  1.609546669 -0.996194766
  [6]  0.830421028  0.669183714 -0.296228223  3.235552382 -0.952010562
 [11] -1.503887994  0.904753665  0.794457408 -0.580242892 -0.198718721
 [16]  1.774983729 -0.908421271  0.116776901  0.272552411  0.121665718
 [21] -0.315664785 -2.970901595  0.896611934  0.905944456 -1.305136179
 [26] -0.015003454 -0.207092051 -1.214274694 -0.120187559  0.779149122
 [31] -1.398236994 -1.190848589  0.082644244 -0.953048063  1.150961350
 [36]  1.367438194  0.790062244 -0.379444783 -0.914588919 -2.802116395
 [41] -0.053040832 -0.576024220 -0.586534102  0.917651416  0.460344864
 [46]  1.889227772  0.195480609  0.735958443  0.500638583  1.820382278
 [51] -0.325935563  0.648878173  0.115965681  0.307062525 -0.219318268
 [56] -0.133565337  0.985682565  0.112718364 -0.926460061 -0.626084242
 [61] -1.972924550  0.309761614  0.270114392  1.146997614 -0.522125863
 [66]  0.298065699 -1.168599816 -1.004038931  0.634028238 -0.790892756
 [71]  1.791401959 -1.784025735  0.031438586  0.516542527 -0.060512316
 [76] -1.473930701  0.416587078 -0.289127626 -1.033687764 -0.390572097
 [81] -0.006761801 -0.171008043  0.075118640 -2.071071470 -1.092287164
 [86]  1.395999925 -1.740745578 -0.185260501  0.973234147  0.973712448
 [91] -0.024294893  0.313279777 -0.557909478 -0.471947701  0.078976809
 [96] -0.082346547  0.658114410  0.522516485  0.471208790 -0.392413460
> colMedians(tmp)
  [1] -0.076980842 -0.464611164  0.718288233  1.609546669 -0.996194766
  [6]  0.830421028  0.669183714 -0.296228223  3.235552382 -0.952010562
 [11] -1.503887994  0.904753665  0.794457408 -0.580242892 -0.198718721
 [16]  1.774983729 -0.908421271  0.116776901  0.272552411  0.121665718
 [21] -0.315664785 -2.970901595  0.896611934  0.905944456 -1.305136179
 [26] -0.015003454 -0.207092051 -1.214274694 -0.120187559  0.779149122
 [31] -1.398236994 -1.190848589  0.082644244 -0.953048063  1.150961350
 [36]  1.367438194  0.790062244 -0.379444783 -0.914588919 -2.802116395
 [41] -0.053040832 -0.576024220 -0.586534102  0.917651416  0.460344864
 [46]  1.889227772  0.195480609  0.735958443  0.500638583  1.820382278
 [51] -0.325935563  0.648878173  0.115965681  0.307062525 -0.219318268
 [56] -0.133565337  0.985682565  0.112718364 -0.926460061 -0.626084242
 [61] -1.972924550  0.309761614  0.270114392  1.146997614 -0.522125863
 [66]  0.298065699 -1.168599816 -1.004038931  0.634028238 -0.790892756
 [71]  1.791401959 -1.784025735  0.031438586  0.516542527 -0.060512316
 [76] -1.473930701  0.416587078 -0.289127626 -1.033687764 -0.390572097
 [81] -0.006761801 -0.171008043  0.075118640 -2.071071470 -1.092287164
 [86]  1.395999925 -1.740745578 -0.185260501  0.973234147  0.973712448
 [91] -0.024294893  0.313279777 -0.557909478 -0.471947701  0.078976809
 [96] -0.082346547  0.658114410  0.522516485  0.471208790 -0.392413460
> colRanges(tmp)
            [,1]       [,2]      [,3]     [,4]       [,5]     [,6]      [,7]
[1,] -0.07698084 -0.4646112 0.7182882 1.609547 -0.9961948 0.830421 0.6691837
[2,] -0.07698084 -0.4646112 0.7182882 1.609547 -0.9961948 0.830421 0.6691837
           [,8]     [,9]      [,10]     [,11]     [,12]     [,13]      [,14]
[1,] -0.2962282 3.235552 -0.9520106 -1.503888 0.9047537 0.7944574 -0.5802429
[2,] -0.2962282 3.235552 -0.9520106 -1.503888 0.9047537 0.7944574 -0.5802429
          [,15]    [,16]      [,17]     [,18]     [,19]     [,20]      [,21]
[1,] -0.1987187 1.774984 -0.9084213 0.1167769 0.2725524 0.1216657 -0.3156648
[2,] -0.1987187 1.774984 -0.9084213 0.1167769 0.2725524 0.1216657 -0.3156648
         [,22]     [,23]     [,24]     [,25]       [,26]      [,27]     [,28]
[1,] -2.970902 0.8966119 0.9059445 -1.305136 -0.01500345 -0.2070921 -1.214275
[2,] -2.970902 0.8966119 0.9059445 -1.305136 -0.01500345 -0.2070921 -1.214275
          [,29]     [,30]     [,31]     [,32]      [,33]      [,34]    [,35]
[1,] -0.1201876 0.7791491 -1.398237 -1.190849 0.08264424 -0.9530481 1.150961
[2,] -0.1201876 0.7791491 -1.398237 -1.190849 0.08264424 -0.9530481 1.150961
        [,36]     [,37]      [,38]      [,39]     [,40]       [,41]      [,42]
[1,] 1.367438 0.7900622 -0.3794448 -0.9145889 -2.802116 -0.05304083 -0.5760242
[2,] 1.367438 0.7900622 -0.3794448 -0.9145889 -2.802116 -0.05304083 -0.5760242
          [,43]     [,44]     [,45]    [,46]     [,47]     [,48]     [,49]
[1,] -0.5865341 0.9176514 0.4603449 1.889228 0.1954806 0.7359584 0.5006386
[2,] -0.5865341 0.9176514 0.4603449 1.889228 0.1954806 0.7359584 0.5006386
        [,50]      [,51]     [,52]     [,53]     [,54]      [,55]      [,56]
[1,] 1.820382 -0.3259356 0.6488782 0.1159657 0.3070625 -0.2193183 -0.1335653
[2,] 1.820382 -0.3259356 0.6488782 0.1159657 0.3070625 -0.2193183 -0.1335653
         [,57]     [,58]      [,59]      [,60]     [,61]     [,62]     [,63]
[1,] 0.9856826 0.1127184 -0.9264601 -0.6260842 -1.972925 0.3097616 0.2701144
[2,] 0.9856826 0.1127184 -0.9264601 -0.6260842 -1.972925 0.3097616 0.2701144
        [,64]      [,65]     [,66]   [,67]     [,68]     [,69]      [,70]
[1,] 1.146998 -0.5221259 0.2980657 -1.1686 -1.004039 0.6340282 -0.7908928
[2,] 1.146998 -0.5221259 0.2980657 -1.1686 -1.004039 0.6340282 -0.7908928
        [,71]     [,72]      [,73]     [,74]       [,75]     [,76]     [,77]
[1,] 1.791402 -1.784026 0.03143859 0.5165425 -0.06051232 -1.473931 0.4165871
[2,] 1.791402 -1.784026 0.03143859 0.5165425 -0.06051232 -1.473931 0.4165871
          [,78]     [,79]      [,80]        [,81]     [,82]      [,83]
[1,] -0.2891276 -1.033688 -0.3905721 -0.006761801 -0.171008 0.07511864
[2,] -0.2891276 -1.033688 -0.3905721 -0.006761801 -0.171008 0.07511864
         [,84]     [,85] [,86]     [,87]      [,88]     [,89]     [,90]
[1,] -2.071071 -1.092287 1.396 -1.740746 -0.1852605 0.9732341 0.9737124
[2,] -2.071071 -1.092287 1.396 -1.740746 -0.1852605 0.9732341 0.9737124
           [,91]     [,92]      [,93]      [,94]      [,95]       [,96]
[1,] -0.02429489 0.3132798 -0.5579095 -0.4719477 0.07897681 -0.08234655
[2,] -0.02429489 0.3132798 -0.5579095 -0.4719477 0.07897681 -0.08234655
         [,97]     [,98]     [,99]     [,100]
[1,] 0.6581144 0.5225165 0.4712088 -0.3924135
[2,] 0.6581144 0.5225165 0.4712088 -0.3924135
> 
> 
> Max(tmp2)
[1] 1.88995
> Min(tmp2)
[1] -3.150902
> mean(tmp2)
[1] -0.0857111
> Sum(tmp2)
[1] -8.57111
> Var(tmp2)
[1] 0.9538535
> 
> rowMeans(tmp2)
  [1] -0.83448673  0.91566368 -1.66480992 -0.21765874  0.02790386  1.41161465
  [7] -0.78426526  0.24151219  0.10636547  1.82307172 -1.17823072 -0.08932670
 [13]  1.00828638  0.27082013 -0.61008982  0.63904858  0.46955909 -1.45842488
 [19] -0.04790882  1.18682024  0.60378441 -1.09260699  0.26733965  1.46745405
 [25] -1.33975748 -0.60444866  0.97157482 -0.82600772  1.27377178  0.63060668
 [31] -0.66157850 -0.20830399 -0.70740853  0.68495824 -0.30269659  0.15750081
 [37] -0.57232384 -0.71846660  0.49101618  0.65194569 -0.49896775 -1.57293221
 [43] -0.06022392  1.57479782  0.39785080 -0.38831296  0.33759762 -0.25366844
 [49] -0.95556350 -0.18742115  1.88995001 -3.15090240  0.83382156  0.91455362
 [55] -0.44014787  0.85235097 -1.03992336 -2.04314187  0.44072976 -0.85115195
 [61]  0.12306619 -0.52845411 -1.39113717  1.15268752 -0.38365961  0.44034107
 [67]  0.05789446  0.66528545  0.82618122 -2.76115677 -0.92012166 -0.19976550
 [73]  0.06123026 -2.09221931  0.47551355  0.22878765 -0.24069243 -0.49167965
 [79] -1.14129032  0.50087860 -0.71926354 -1.05716193  0.89291456 -0.83067935
 [85] -0.03235384  1.17531843  0.07448919 -0.39700362 -1.21214704 -1.68388105
 [91]  0.99334633  1.32542587 -0.20113273 -0.52596565  1.17843970 -1.09351197
 [97] -0.11256228  0.35050073  0.74978678  0.99152907
> rowSums(tmp2)
  [1] -0.83448673  0.91566368 -1.66480992 -0.21765874  0.02790386  1.41161465
  [7] -0.78426526  0.24151219  0.10636547  1.82307172 -1.17823072 -0.08932670
 [13]  1.00828638  0.27082013 -0.61008982  0.63904858  0.46955909 -1.45842488
 [19] -0.04790882  1.18682024  0.60378441 -1.09260699  0.26733965  1.46745405
 [25] -1.33975748 -0.60444866  0.97157482 -0.82600772  1.27377178  0.63060668
 [31] -0.66157850 -0.20830399 -0.70740853  0.68495824 -0.30269659  0.15750081
 [37] -0.57232384 -0.71846660  0.49101618  0.65194569 -0.49896775 -1.57293221
 [43] -0.06022392  1.57479782  0.39785080 -0.38831296  0.33759762 -0.25366844
 [49] -0.95556350 -0.18742115  1.88995001 -3.15090240  0.83382156  0.91455362
 [55] -0.44014787  0.85235097 -1.03992336 -2.04314187  0.44072976 -0.85115195
 [61]  0.12306619 -0.52845411 -1.39113717  1.15268752 -0.38365961  0.44034107
 [67]  0.05789446  0.66528545  0.82618122 -2.76115677 -0.92012166 -0.19976550
 [73]  0.06123026 -2.09221931  0.47551355  0.22878765 -0.24069243 -0.49167965
 [79] -1.14129032  0.50087860 -0.71926354 -1.05716193  0.89291456 -0.83067935
 [85] -0.03235384  1.17531843  0.07448919 -0.39700362 -1.21214704 -1.68388105
 [91]  0.99334633  1.32542587 -0.20113273 -0.52596565  1.17843970 -1.09351197
 [97] -0.11256228  0.35050073  0.74978678  0.99152907
> 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.83448673  0.91566368 -1.66480992 -0.21765874  0.02790386  1.41161465
  [7] -0.78426526  0.24151219  0.10636547  1.82307172 -1.17823072 -0.08932670
 [13]  1.00828638  0.27082013 -0.61008982  0.63904858  0.46955909 -1.45842488
 [19] -0.04790882  1.18682024  0.60378441 -1.09260699  0.26733965  1.46745405
 [25] -1.33975748 -0.60444866  0.97157482 -0.82600772  1.27377178  0.63060668
 [31] -0.66157850 -0.20830399 -0.70740853  0.68495824 -0.30269659  0.15750081
 [37] -0.57232384 -0.71846660  0.49101618  0.65194569 -0.49896775 -1.57293221
 [43] -0.06022392  1.57479782  0.39785080 -0.38831296  0.33759762 -0.25366844
 [49] -0.95556350 -0.18742115  1.88995001 -3.15090240  0.83382156  0.91455362
 [55] -0.44014787  0.85235097 -1.03992336 -2.04314187  0.44072976 -0.85115195
 [61]  0.12306619 -0.52845411 -1.39113717  1.15268752 -0.38365961  0.44034107
 [67]  0.05789446  0.66528545  0.82618122 -2.76115677 -0.92012166 -0.19976550
 [73]  0.06123026 -2.09221931  0.47551355  0.22878765 -0.24069243 -0.49167965
 [79] -1.14129032  0.50087860 -0.71926354 -1.05716193  0.89291456 -0.83067935
 [85] -0.03235384  1.17531843  0.07448919 -0.39700362 -1.21214704 -1.68388105
 [91]  0.99334633  1.32542587 -0.20113273 -0.52596565  1.17843970 -1.09351197
 [97] -0.11256228  0.35050073  0.74978678  0.99152907
> rowMin(tmp2)
  [1] -0.83448673  0.91566368 -1.66480992 -0.21765874  0.02790386  1.41161465
  [7] -0.78426526  0.24151219  0.10636547  1.82307172 -1.17823072 -0.08932670
 [13]  1.00828638  0.27082013 -0.61008982  0.63904858  0.46955909 -1.45842488
 [19] -0.04790882  1.18682024  0.60378441 -1.09260699  0.26733965  1.46745405
 [25] -1.33975748 -0.60444866  0.97157482 -0.82600772  1.27377178  0.63060668
 [31] -0.66157850 -0.20830399 -0.70740853  0.68495824 -0.30269659  0.15750081
 [37] -0.57232384 -0.71846660  0.49101618  0.65194569 -0.49896775 -1.57293221
 [43] -0.06022392  1.57479782  0.39785080 -0.38831296  0.33759762 -0.25366844
 [49] -0.95556350 -0.18742115  1.88995001 -3.15090240  0.83382156  0.91455362
 [55] -0.44014787  0.85235097 -1.03992336 -2.04314187  0.44072976 -0.85115195
 [61]  0.12306619 -0.52845411 -1.39113717  1.15268752 -0.38365961  0.44034107
 [67]  0.05789446  0.66528545  0.82618122 -2.76115677 -0.92012166 -0.19976550
 [73]  0.06123026 -2.09221931  0.47551355  0.22878765 -0.24069243 -0.49167965
 [79] -1.14129032  0.50087860 -0.71926354 -1.05716193  0.89291456 -0.83067935
 [85] -0.03235384  1.17531843  0.07448919 -0.39700362 -1.21214704 -1.68388105
 [91]  0.99334633  1.32542587 -0.20113273 -0.52596565  1.17843970 -1.09351197
 [97] -0.11256228  0.35050073  0.74978678  0.99152907
> 
> colMeans(tmp2)
[1] -0.0857111
> colSums(tmp2)
[1] -8.57111
> colVars(tmp2)
[1] 0.9538535
> colSd(tmp2)
[1] 0.9766543
> colMax(tmp2)
[1] 1.88995
> colMin(tmp2)
[1] -3.150902
> colMedians(tmp2)
[1] -0.05406637
> colRanges(tmp2)
          [,1]
[1,] -3.150902
[2,]  1.889950
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -3.631865  1.012097  2.815899  2.568570  5.855655 -1.737475 -2.127640
 [8]  4.001924  3.923290 -4.772118
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.4722587
[2,] -0.3990457
[3,] -0.3248291
[4,] -0.1820507
[5,]  0.6677033
> 
> rowApply(tmp,sum)
 [1] -1.6002940 -1.5170646  1.6642959 -1.0015006 -2.8277578  1.3815143
 [7]  4.1277063  0.3746199  6.7472372  0.5595815
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    5    5    2    5    6    8    2    1    4     4
 [2,]   10    4    6    3    3    5    7    8    6     6
 [3,]    9    6    7    6    4    1    5   10    7     9
 [4,]    1    9    5    7    9    4   10    3    8     5
 [5,]    2   10    4    8    7    9    6    4   10    10
 [6,]    8    3    3    4    8    3    4    5    1     3
 [7,]    7    2   10    2    2    2    3    6    2     8
 [8,]    6    1    8   10    5    6    8    9    9     2
 [9,]    3    8    9    9   10    7    1    7    5     1
[10,]    4    7    1    1    1   10    9    2    3     7
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.3059826 -0.9045746  1.6559036  2.2518455  2.4238578  0.8440302
 [7] -1.7393958 -0.2576498  0.4063029 -2.4627142 -1.9524151 -4.2629148
[13]  4.6754955  0.7540871  2.7277784 -3.1659810 -0.6688080  1.3682752
[19]  0.4634906  0.8802092
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.8737707
[2,] -0.3767631
[3,] -0.1070552
[4,]  0.3882223
[5,]  0.6633841
> 
> rowApply(tmp,sum)
[1] -0.61201863  2.12156632 -1.84500557 -0.06092585  3.12722381
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   13   13   11    3   12
[2,]   16   18    4    4    2
[3,]    9   17    6   14   19
[4,]   10   14   12   17   17
[5,]   20    6   18   18    1
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
[1,] -0.1070552  0.8865018 -0.3767903 -0.3715900  2.1741767  1.5250690
[2,]  0.6633841  1.1891402  0.8890269  0.6921754 -0.2537416 -0.4553901
[3,] -0.3767631 -1.0988078 -0.5781003 -0.2702621  1.0902931  0.8954262
[4,] -0.8737707 -0.7692697  0.2907877  0.9788031  1.0197121 -0.5079672
[5,]  0.3882223 -1.1121392  1.4309797  1.2227190 -1.6065825 -0.6131077
            [,7]       [,8]       [,9]      [,10]      [,11]      [,12]
[1,] -0.61678200 -1.4802054  0.1609519 -0.2083011 -1.5066485 -0.3893520
[2,] -1.96688977  0.2455619  0.2310848  0.3776557 -0.1908299 -0.9505165
[3,] -0.48595712  1.9955436 -0.4939615 -1.5750094  0.7847516 -1.4118176
[4,]  0.09947056 -0.3077704  1.2520855 -0.3182423 -1.3007163 -1.1811840
[5,]  1.23076255 -0.7107796 -0.7438578 -0.7388172  0.2610280 -0.3300446
         [,13]      [,14]       [,15]      [,16]      [,17]      [,18]
[1,] 1.1945288  1.8912378  0.47851718 -0.8258494 -0.7378505 -1.2926700
[2,] 0.7617112 -1.2801747  2.08200157 -2.7436036  0.3155963 -0.1110347
[3,] 1.3001074 -0.4598582  0.01149801 -1.2757955  0.1400045 -0.3955438
[4,] 0.9241322 -0.2997802 -0.29389861  0.8026274 -0.1727552  1.2326724
[5,] 0.4950160  0.9026625  0.44966022  0.8766402 -0.2138031  1.9348513
          [,19]       [,20]
[1,] -0.6496600 -0.36024727
[2,]  1.8465377  0.77987132
[3,] -0.5863899  0.94563645
[4,] -0.1268904 -0.50897184
[5,] -0.0201067  0.02392056
> 
> 
> 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 :  648  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  562  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 1.420297 -1.454637 0.2505494 2.056709 -1.134728 0.4497942 0.6362926
          col8      col9      col10     col11     col12       col13      col14
row1 0.2605102 0.6837089 -0.9394761 -1.213741 -1.304571 -0.05550012 -0.5364633
         col15     col16      col17     col18     col19    col20
row1 0.3573758 0.0731427 -0.1486669 0.7950203 0.3610057 1.060476
> tmp[,"col10"]
           col10
row1 -0.93947610
row2 -0.21962265
row3  0.42850558
row4 -0.02913451
row5 -0.34839531
> tmp[c("row1","row5"),]
           col1      col2       col3      col4      col5        col6       col7
row1  1.4202973 -1.454637  0.2505494 2.0567088 -1.134728  0.44979425  0.6362926
row5 -0.3535142  1.754144 -0.1353420 0.1915787 -1.361334 -0.09260783 -0.1115134
          col8      col9      col10      col11      col12       col13
row1 0.2605102 0.6837089 -0.9394761 -1.2137414 -1.3045713 -0.05550012
row5 0.1934171 0.8761254 -0.3483953  0.1075734 -0.4185848  0.13976557
          col14     col15      col16      col17     col18      col19      col20
row1 -0.5364633 0.3573758  0.0731427 -0.1486669 0.7950203  0.3610057  1.0604759
row5 -0.8259343 0.5614879 -1.3909244 -0.3079950 1.1560415 -0.2584090 -0.1555821
> tmp[,c("col6","col20")]
            col6      col20
row1  0.44979425  1.0604759
row2 -0.25644308  0.3464806
row3 -0.96387868  0.3948869
row4 -0.08368628 -1.0851416
row5 -0.09260783 -0.1555821
> tmp[c("row1","row5"),c("col6","col20")]
            col6      col20
row1  0.44979425  1.0604759
row5 -0.09260783 -0.1555821
> 
> 
> 
> 
> 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 47.30094 49.08175 50.68085 49.79916 50.18136 106.1017 48.76627 49.56101
         col9    col10    col11    col12    col13    col14    col15    col16
row1 47.67481 50.56933 50.67054 50.57776 47.94137 49.74372 51.47827 49.52828
        col17    col18   col19    col20
row1 50.58477 50.93946 50.0073 106.9914
> tmp[,"col10"]
        col10
row1 50.56933
row2 28.52841
row3 29.01175
row4 31.10135
row5 50.23113
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 47.30094 49.08175 50.68085 49.79916 50.18136 106.1017 48.76627 49.56101
row5 49.69529 50.09614 49.96560 50.54597 50.15982 104.2796 48.57901 52.39217
         col9    col10    col11    col12    col13    col14    col15    col16
row1 47.67481 50.56933 50.67054 50.57776 47.94137 49.74372 51.47827 49.52828
row5 49.32793 50.23113 49.08302 49.13453 50.95901 51.26230 50.19428 51.59825
        col17    col18   col19    col20
row1 50.58477 50.93946 50.0073 106.9914
row5 48.61187 51.05072 49.6331 105.2855
> tmp[,c("col6","col20")]
          col6     col20
row1 106.10174 106.99139
row2  74.29468  75.00303
row3  74.41003  74.04033
row4  74.79120  75.05705
row5 104.27956 105.28546
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 106.1017 106.9914
row5 104.2796 105.2855
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 106.1017 106.9914
row5 104.2796 105.2855
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,] -0.31277096
[2,] -0.60840886
[3,] -0.61014765
[4,]  0.96395231
[5,] -0.03567421
> tmp[,c("col17","col7")]
           col17       col7
[1,]  1.44946942  0.2840467
[2,]  0.52206974  1.3729454
[3,] -0.34940055  0.9576918
[4,] -0.22157556  0.7638360
[5,] -0.06796738 -0.0613374
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -1.1478844 -0.6387328
[2,] -0.1557958 -0.7818024
[3,] -0.3050748 -0.5417928
[4,]  1.7595891  0.5735580
[5,] -0.3563553  1.3813067
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -1.147884
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -1.1478844
[2,] -0.1557958
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]        [,2]       [,3]       [,4]      [,5]       [,6]
row3 -1.1573944  0.50531787  0.7178785 -0.7603119 0.9320929 0.05271228
row1 -0.2737809 -0.03204562 -0.1042524  1.9277869 1.1252167 0.48816747
           [,7]       [,8]       [,9]     [,10]      [,11]     [,12]      [,13]
row3 -1.8183224 -1.1828470  0.2930819 -0.973566  0.9771475 0.8639404  0.4054529
row1  0.7573451 -0.1181162 -0.6333097  1.364831 -0.7575110 0.8023731 -1.7863823
           [,14]      [,15]      [,16]     [,17]      [,18]      [,19]
row3 -1.17659175 -0.4750582  0.8637401  1.636131 -0.4678707 -0.1868623
row1  0.06580568 -0.7699538 -0.5561966 -1.519826  0.8593742 -0.4799610
          [,20]
row3  0.4906457
row1 -1.6572350
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]       [,2]      [,3]     [,4]     [,5]       [,6]      [,7]
row2 0.338096 -0.3374274 0.8680515 2.309414 1.249961 -0.7432701 0.4045369
         [,8]      [,9]      [,10]
row2 1.145144 -1.119174 -0.4278526
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]       [,2]        [,3]      [,4]      [,5]      [,6]     [,7]
row5 -0.5088789 -0.6064676 -0.06080714 -1.716359 0.1410151 0.1443671 1.236971
          [,8]       [,9]     [,10]      [,11]      [,12]   [,13]       [,14]
row5 -0.818311 -0.1138502 0.6528139 -0.3620912 -0.5925152 1.89195 -0.08111299
         [,15]     [,16]      [,17]    [,18]    [,19]     [,20]
row5 0.4173214 -1.626399 -0.4742676 1.253008 1.293882 0.7513808
> 
> 
> 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: 0xfa29aa0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c09b2f62609" 
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c09b3485ca4f"
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c09b25534d74"
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c09b63af4093"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c09b3269a02f"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c09b4b555d12"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c09b6804652f"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c09b13aac4fe"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c09b747b5c65"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c09b70c01905"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c09b24327417"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c09b16700b76"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c09b519114d7"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c09b8b96854" 
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c09b418005ea"
> 
> 
> ### 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: 0x10efea00>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x10efea00>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x10efea00>
> rowMedians(tmp)
  [1] -0.122232492  0.098914939 -0.375754318 -0.216368780  0.268054979
  [6]  0.594346164 -0.214419860  0.128983473 -0.248551693  0.375428799
 [11]  0.350262567 -0.068772670  0.258302701 -0.058708110 -0.229437450
 [16] -0.058844435  0.339089883 -0.195374891  0.081046805 -0.040206283
 [21] -0.008534181 -0.421582622  0.576967999 -0.604073964  0.135006709
 [26]  0.158008445  0.057445481 -1.096531843 -0.328461930  0.170833786
 [31]  0.175134012 -0.504363945  0.610338387 -0.327236543  0.299335426
 [36] -0.104857370  0.021550218  0.937205403 -0.059236441  0.237068430
 [41]  0.300181231 -0.216658584 -0.217056905 -0.516549446 -0.365012950
 [46]  0.031737285  0.053369469 -0.474240491  0.078721579 -0.429983449
 [51]  0.502108854 -0.333175732 -0.178229159 -0.399185165  0.231270899
 [56] -0.062942445  0.109966696 -0.274217255 -0.584112535  0.764429630
 [61] -1.013009547 -0.167482397  0.012506691 -0.477316906 -0.830513337
 [66]  0.441917415  0.164743311 -0.139099279  0.312109618  0.083169953
 [71]  0.340150261  0.088249870  0.522014662  0.306713637  0.091586457
 [76] -0.302315862  0.572092690 -0.172062740 -0.526162842 -0.041372259
 [81] -0.217270860 -0.306676022 -0.013464694  0.310203889 -0.383854479
 [86] -0.175484969  0.100287871  0.124754551 -0.170571560 -0.054436201
 [91]  0.038524453  0.103584527 -0.191159830 -0.314591310  0.182111129
 [96] -0.597589197 -0.530853706  0.149745721 -0.125255270 -0.127831590
[101] -0.397799297  0.197468569 -0.327116653  0.227688730 -0.276217702
[106]  0.192929245 -0.035303967  0.404098566  0.153890892 -0.007657003
[111] -0.578079508 -0.237581721  0.258961584  0.199513627 -0.202230484
[116]  0.678608875 -0.346279421 -0.235414241  0.271453314 -0.102223049
[121] -0.567199489  0.193892924 -0.151054227 -0.135910956 -0.108586074
[126]  0.116485748 -0.040705170  0.090028733  0.125580296 -0.705650637
[131]  0.246270446  0.366499662  0.017894962 -0.096762263 -0.368002152
[136]  0.167459568  0.075658638  0.315378917  0.186338404  0.129510890
[141]  0.175567517 -0.100068373  0.229476904 -0.200824386 -0.361869199
[146]  0.335922281  0.132306204 -0.174665546  0.128451866 -0.097465811
[151]  0.197649637  0.083394731 -0.208095366 -0.197525286 -0.347372709
[156] -0.626913710  0.248532913  0.311700757  0.065628899  0.095402636
[161] -0.326191056  0.119460064 -0.099629821 -0.096640260  0.380324149
[166]  0.202700752 -0.418691749 -0.290151770  0.107369133  0.009029441
[171]  0.020794956  0.509252779  0.036298261  0.244183623 -0.088325523
[176] -0.039588351 -0.204652761 -0.202054313  0.205601341 -0.296880497
[181] -0.080485068  0.248694290  0.058191689 -0.546876742 -0.754307128
[186]  0.204755675 -0.959039516 -0.200460980  0.100810287  0.165268412
[191] -0.094578878 -0.288389152  0.249558536  0.057779622  0.458200037
[196] -0.291910973 -0.241019706  0.239092154 -0.442290558 -0.242962749
[201]  0.158532994  0.159319788  0.322410099  0.322480822 -0.824750538
[206]  0.189552410  0.427020071 -0.368501660  0.013642137 -0.004196458
[211] -0.284852268  0.163119402 -0.189922086  0.294367975 -0.559511748
[216]  0.088631590 -0.239220897  0.220441177 -0.235239656  0.113043253
[221]  0.277957022  0.426121490 -0.292198859 -0.281545575  0.063852587
[226] -0.066787443 -0.173210542  0.297117903  0.235066351  0.406158676
> 
> proc.time()
   user  system elapsed 
  1.879   0.842   2.747 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-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: 0x30482ff0>
> .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: 0x30482ff0>
> .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: 0x30482ff0>
> .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: 0x30482ff0>
> 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: 0x303680e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x303680e0>
> .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: 0x303680e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x303680e0>
> .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: 0x303680e0>
> 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: 0x2f2ef520>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2f2ef520>
> .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: 0x2f2ef520>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x2f2ef520>
> .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: 0x2f2ef520>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x2f2ef520>
> .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: 0x2f2ef520>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x2f2ef520>
> .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: 0x2f2ef520>
> 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: 0x2ecf3720>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x2ecf3720>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2ecf3720>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2ecf3720>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2c28936baeed7" "BufferedMatrixFile2c28942233c68"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2c28936baeed7" "BufferedMatrixFile2c28942233c68"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x2fbe37d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2fbe37d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x2fbe37d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x2fbe37d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x2fbe37d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x2fbe37d0>
> .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: 0x2fceac90>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2fceac90>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x2fceac90>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x2fceac90>
> 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: 0x30f93110>
> .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: 0x30f93110>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.329   0.038   0.352 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-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.329   0.039   0.352 

Example timings