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

This page was generated on 2026-04-27 11:32 -0400 (Mon, 27 Apr 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.4 LTS)x86_644.6.0 RC (2026-04-17 r89917) -- "Because it was There" 4980
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 262/2417HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-04-26 13:40 -0400 (Sun, 26 Apr 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: ecdbf23
git_last_commit_date: 2025-10-29 09:58:55 -0400 (Wed, 29 Oct 2025)
nebbiolo1Linux (Ubuntu 24.04.4 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
See other builds for BufferedMatrix in R Universe.


CHECK results for BufferedMatrix on nebbiolo1

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

raw results


Summary

Package: BufferedMatrix
Version: 1.75.0
Command: /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz
StartedAt: 2026-04-26 22:01:25 -0400 (Sun, 26 Apr 2026)
EndedAt: 2026-04-26 22:01:50 -0400 (Sun, 26 Apr 2026)
EllapsedTime: 25.1 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.247   0.050   0.285 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 480233 25.7    1053308 56.3   637571 34.1
Vcells 887253  6.8    8388608 64.0  2083896 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] "Sun Apr 26 22:01:41 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Sun Apr 26 22:01:41 2026"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x6219233148e0>
> 
> 
> 
> 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] "Sun Apr 26 22:01:41 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Sun Apr 26 22:01:42 2026"
> 
> ColMode(tmp2)
<pointer: 0x6219233148e0>
> 
> 
> 
> ### 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.2934438 -0.5017787  0.4771174  0.51995194
[2,]   0.1936197  0.5633830 -1.1150116 -0.94293251
[3,]  -1.1280058 -0.4910196  2.2130671  0.05514873
[4,]  -0.3830620  0.9119914  1.4147493 -1.56610156
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]       [,4]
[1,] 100.2934438 0.5017787 0.4771174 0.51995194
[2,]   0.1936197 0.5633830 1.1150116 0.94293251
[3,]   1.1280058 0.4910196 2.2130671 0.05514873
[4,]   0.3830620 0.9119914 1.4147493 1.56610156
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0146614 0.7083634 0.6907369 0.7210769
[2,]  0.4400224 0.7505884 1.0559411 0.9710471
[3,]  1.0620762 0.7007279 1.4876381 0.2348377
[4,]  0.6189200 0.9549824 1.1894323 1.2514398
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.44006 32.58541 32.38449 32.73072
[2,]  29.59384 33.06927 36.67442 35.65340
[3,]  36.74877 32.49830 42.08945 27.40353
[4,]  31.57226 35.46182 38.30907 39.08050
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6219233d6900>
> exp(tmp5)
<pointer: 0x6219233d6900>
> log(tmp5,2)
<pointer: 0x6219233d6900>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.2239
> Min(tmp5)
[1] 53.14131
> mean(tmp5)
[1] 71.5108
> Sum(tmp5)
[1] 14302.16
> Var(tmp5)
[1] 867.7157
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.53374 69.52546 65.13652 72.36665 69.14524 69.16396 69.72330 68.18106
 [9] 71.93742 68.39470
> rowSums(tmp5)
 [1] 1830.675 1390.509 1302.730 1447.333 1382.905 1383.279 1394.466 1363.621
 [9] 1438.748 1367.894
> rowVars(tmp5)
 [1] 7968.61312   70.34777   78.21312   91.10500   67.19452   83.61509
 [7]   62.84329   40.15558   55.12852   64.12051
> rowSd(tmp5)
 [1] 89.267089  8.387358  8.843818  9.544894  8.197226  9.144129  7.927376
 [8]  6.336843  7.424858  8.007528
> rowMax(tmp5)
 [1] 469.22394  85.72472  87.60367  88.80335  88.39617  87.80963  84.02742
 [8]  80.04228  90.85246  82.36643
> rowMin(tmp5)
 [1] 57.48472 54.03363 53.14131 54.07897 53.88989 56.21728 53.87525 60.45064
 [9] 61.03554 57.14913
> 
> colMeans(tmp5)
 [1] 107.76945  70.80519  71.88624  67.35963  68.23748  68.28532  69.27658
 [8]  70.96049  66.75389  68.20879  64.52415  69.82544  68.69712  68.12456
[15]  72.47441  71.32946  75.50473  72.37261  67.39535  70.42519
> colSums(tmp5)
 [1] 1077.6945  708.0519  718.8624  673.5963  682.3748  682.8532  692.7658
 [8]  709.6049  667.5389  682.0879  645.2415  698.2544  686.9712  681.2456
[15]  724.7441  713.2946  755.0473  723.7261  673.9535  704.2519
> colVars(tmp5)
 [1] 16220.44867    13.68709    82.64295    65.40396    46.78686   102.70431
 [7]    64.73812    75.70074    39.01442    39.08049    52.26692   145.70947
[13]    40.09959   116.88242   117.32394    54.20631    43.54147    81.87281
[19]    58.61164    59.53304
> colSd(tmp5)
 [1] 127.359525   3.699607   9.090817   8.087272   6.840092  10.134314
 [7]   8.046000   8.700617   6.246152   6.251439   7.229586  12.071018
[13]   6.332424  10.811217  10.831618   7.362493   6.598596   9.048360
[19]   7.655824   7.715766
> colMax(tmp5)
 [1] 469.22394  77.56007  87.60367  81.34094  77.87103  85.72472  80.54039
 [8]  83.44188  80.53677  76.52835  77.63173  88.80335  80.66816  81.60766
[15]  90.85246  86.02150  84.02742  84.47775  78.71538  81.15474
> colMin(tmp5)
 [1] 56.21728 66.02802 57.14913 56.51413 58.62425 54.41103 53.88989 57.48472
 [9] 58.12809 58.42123 54.07897 57.00063 60.65020 54.03363 53.14131 59.27451
[17] 66.12315 54.63498 53.87525 61.03554
> 
> 
> ### 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] 91.53374 69.52546 65.13652 72.36665 69.14524       NA 69.72330 68.18106
 [9] 71.93742 68.39470
> rowSums(tmp5)
 [1] 1830.675 1390.509 1302.730 1447.333 1382.905       NA 1394.466 1363.621
 [9] 1438.748 1367.894
> rowVars(tmp5)
 [1] 7968.61312   70.34777   78.21312   91.10500   67.19452   87.97348
 [7]   62.84329   40.15558   55.12852   64.12051
> rowSd(tmp5)
 [1] 89.267089  8.387358  8.843818  9.544894  8.197226  9.379418  7.927376
 [8]  6.336843  7.424858  8.007528
> rowMax(tmp5)
 [1] 469.22394  85.72472  87.60367  88.80335  88.39617        NA  84.02742
 [8]  80.04228  90.85246  82.36643
> rowMin(tmp5)
 [1] 57.48472 54.03363 53.14131 54.07897 53.88989       NA 53.87525 60.45064
 [9] 61.03554 57.14913
> 
> colMeans(tmp5)
 [1] 107.76945  70.80519  71.88624  67.35963  68.23748  68.28532  69.27658
 [8]  70.96049  66.75389  68.20879  64.52415  69.82544  68.69712  68.12456
[15]  72.47441  71.32946        NA  72.37261  67.39535  70.42519
> colSums(tmp5)
 [1] 1077.6945  708.0519  718.8624  673.5963  682.3748  682.8532  692.7658
 [8]  709.6049  667.5389  682.0879  645.2415  698.2544  686.9712  681.2456
[15]  724.7441  713.2946        NA  723.7261  673.9535  704.2519
> colVars(tmp5)
 [1] 16220.44867    13.68709    82.64295    65.40396    46.78686   102.70431
 [7]    64.73812    75.70074    39.01442    39.08049    52.26692   145.70947
[13]    40.09959   116.88242   117.32394    54.20631          NA    81.87281
[19]    58.61164    59.53304
> colSd(tmp5)
 [1] 127.359525   3.699607   9.090817   8.087272   6.840092  10.134314
 [7]   8.046000   8.700617   6.246152   6.251439   7.229586  12.071018
[13]   6.332424  10.811217  10.831618   7.362493         NA   9.048360
[19]   7.655824   7.715766
> colMax(tmp5)
 [1] 469.22394  77.56007  87.60367  81.34094  77.87103  85.72472  80.54039
 [8]  83.44188  80.53677  76.52835  77.63173  88.80335  80.66816  81.60766
[15]  90.85246  86.02150        NA  84.47775  78.71538  81.15474
> colMin(tmp5)
 [1] 56.21728 66.02802 57.14913 56.51413 58.62425 54.41103 53.88989 57.48472
 [9] 58.12809 58.42123 54.07897 57.00063 60.65020 54.03363 53.14131 59.27451
[17]       NA 54.63498 53.87525 61.03554
> 
> Max(tmp5,na.rm=TRUE)
[1] 469.2239
> Min(tmp5,na.rm=TRUE)
[1] 53.14131
> mean(tmp5,na.rm=TRUE)
[1] 71.51147
> Sum(tmp5,na.rm=TRUE)
[1] 14230.78
> Var(tmp5,na.rm=TRUE)
[1] 872.098
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.53374 69.52546 65.13652 72.36665 69.14524 69.04739 69.72330 68.18106
 [9] 71.93742 68.39470
> rowSums(tmp5,na.rm=TRUE)
 [1] 1830.675 1390.509 1302.730 1447.333 1382.905 1311.900 1394.466 1363.621
 [9] 1438.748 1367.894
> rowVars(tmp5,na.rm=TRUE)
 [1] 7968.61312   70.34777   78.21312   91.10500   67.19452   87.97348
 [7]   62.84329   40.15558   55.12852   64.12051
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.267089  8.387358  8.843818  9.544894  8.197226  9.379418  7.927376
 [8]  6.336843  7.424858  8.007528
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.22394  85.72472  87.60367  88.80335  88.39617  87.80963  84.02742
 [8]  80.04228  90.85246  82.36643
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.48472 54.03363 53.14131 54.07897 53.88989 56.21728 53.87525 60.45064
 [9] 61.03554 57.14913
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 107.76945  70.80519  71.88624  67.35963  68.23748  68.28532  69.27658
 [8]  70.96049  66.75389  68.20879  64.52415  69.82544  68.69712  68.12456
[15]  72.47441  71.32946  75.96316  72.37261  67.39535  70.42519
> colSums(tmp5,na.rm=TRUE)
 [1] 1077.6945  708.0519  718.8624  673.5963  682.3748  682.8532  692.7658
 [8]  709.6049  667.5389  682.0879  645.2415  698.2544  686.9712  681.2456
[15]  724.7441  713.2946  683.6684  723.7261  673.9535  704.2519
> colVars(tmp5,na.rm=TRUE)
 [1] 16220.44867    13.68709    82.64295    65.40396    46.78686   102.70431
 [7]    64.73812    75.70074    39.01442    39.08049    52.26692   145.70947
[13]    40.09959   116.88242   117.32394    54.20631    46.61989    81.87281
[19]    58.61164    59.53304
> colSd(tmp5,na.rm=TRUE)
 [1] 127.359525   3.699607   9.090817   8.087272   6.840092  10.134314
 [7]   8.046000   8.700617   6.246152   6.251439   7.229586  12.071018
[13]   6.332424  10.811217  10.831618   7.362493   6.827876   9.048360
[19]   7.655824   7.715766
> colMax(tmp5,na.rm=TRUE)
 [1] 469.22394  77.56007  87.60367  81.34094  77.87103  85.72472  80.54039
 [8]  83.44188  80.53677  76.52835  77.63173  88.80335  80.66816  81.60766
[15]  90.85246  86.02150  84.02742  84.47775  78.71538  81.15474
> colMin(tmp5,na.rm=TRUE)
 [1] 56.21728 66.02802 57.14913 56.51413 58.62425 54.41103 53.88989 57.48472
 [9] 58.12809 58.42123 54.07897 57.00063 60.65020 54.03363 53.14131 59.27451
[17] 66.12315 54.63498 53.87525 61.03554
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.53374 69.52546 65.13652 72.36665 69.14524      NaN 69.72330 68.18106
 [9] 71.93742 68.39470
> rowSums(tmp5,na.rm=TRUE)
 [1] 1830.675 1390.509 1302.730 1447.333 1382.905    0.000 1394.466 1363.621
 [9] 1438.748 1367.894
> rowVars(tmp5,na.rm=TRUE)
 [1] 7968.61312   70.34777   78.21312   91.10500   67.19452         NA
 [7]   62.84329   40.15558   55.12852   64.12051
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.267089  8.387358  8.843818  9.544894  8.197226        NA  7.927376
 [8]  6.336843  7.424858  8.007528
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.22394  85.72472  87.60367  88.80335  88.39617        NA  84.02742
 [8]  80.04228  90.85246  82.36643
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.48472 54.03363 53.14131 54.07897 53.88989       NA 53.87525 60.45064
 [9] 61.03554 57.14913
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.49747  70.65184  72.83822  68.56469  69.30561  67.21132  68.93130
 [8]  69.86926  65.22246  67.79763  64.24694  67.82720  69.13524  69.41683
[15]  73.65487  71.61225       NaN  72.89295  67.55903  69.23302
> colSums(tmp5,na.rm=TRUE)
 [1] 1021.4772  635.8666  655.5440  617.0822  623.7505  604.9019  620.3817
 [8]  628.8233  587.0022  610.1787  578.2224  610.4448  622.2172  624.7515
[15]  662.8938  644.5102    0.0000  656.0365  608.0313  623.0972
> colVars(tmp5,na.rm=TRUE)
 [1] 17878.88997    15.13342    82.77784    57.24267    39.79993   102.56588
 [7]    71.48918    71.76696    17.50683    42.06376    57.93574   119.00219
[13]    42.95256   112.70555   116.31283    60.08242          NA    89.06098
[19]    65.63670    50.98533
> colSd(tmp5,na.rm=TRUE)
 [1] 133.711966   3.890170   9.098233   7.565888   6.308718  10.127481
 [7]   8.455127   8.471538   4.184117   6.485658   7.611553  10.908812
[13]   6.553820  10.616287  10.784842   7.751285         NA   9.437212
[19]   8.101648   7.140401
> colMax(tmp5,na.rm=TRUE)
 [1] 469.22394  77.56007  87.60367  81.34094  77.87103  85.72472  80.54039
 [8]  83.44188  69.98401  76.52835  77.63173  88.80335  80.66816  81.60766
[15]  90.85246  86.02150      -Inf  84.47775  78.71538  78.93929
> colMin(tmp5,na.rm=TRUE)
 [1] 57.25275 66.02802 57.14913 57.03685 60.45064 54.41103 53.88989 57.48472
 [9] 58.12809 58.42123 54.07897 57.00063 60.65020 54.03363 53.14131 59.27451
[17]      Inf 54.63498 53.87525 61.03554
> 
> 
> 
> 
> 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] 180.05054 128.99572 162.54576 162.15450 174.66886 235.49700 117.07258
 [8] 237.23796  88.41603 282.10844
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 180.05054 128.99572 162.54576 162.15450 174.66886 235.49700 117.07258
 [8] 237.23796  88.41603 282.10844
> 
> 
> 
> 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]  0.000000e+00 -2.842171e-14 -1.421085e-14  5.684342e-14 -8.526513e-14
 [6]  8.526513e-14  5.684342e-14  0.000000e+00  2.131628e-14 -5.684342e-14
[11]  5.684342e-14  5.684342e-14 -5.684342e-14  1.136868e-13  4.263256e-14
[16]  2.273737e-13  2.842171e-14  0.000000e+00  1.705303e-13  1.136868e-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)
+ }
9   14 
6   19 
6   19 
6   3 
1   6 
2   15 
9   8 
7   13 
2   7 
8   1 
7   17 
3   19 
7   18 
5   9 
7   20 
8   1 
8   14 
3   5 
6   16 
7   2 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.633651
> Min(tmp)
[1] -2.503098
> mean(tmp)
[1] 0.09305181
> Sum(tmp)
[1] 9.305181
> Var(tmp)
[1] 1.001384
> 
> rowMeans(tmp)
[1] 0.09305181
> rowSums(tmp)
[1] 9.305181
> rowVars(tmp)
[1] 1.001384
> rowSd(tmp)
[1] 1.000692
> rowMax(tmp)
[1] 2.633651
> rowMin(tmp)
[1] -2.503098
> 
> colMeans(tmp)
  [1]  0.071633408  1.119865045 -0.123533003 -1.510213201 -0.866800812
  [6]  0.422602944 -1.468979075 -2.503098074  0.849017014  0.215459022
 [11]  0.839763686  0.430523972  1.411033207 -0.121618038 -0.085437995
 [16]  0.281621924  0.316050633  2.633650674 -0.665778350  1.423436400
 [21] -0.288244888  0.888212574 -0.556940346 -0.526688072  1.116797139
 [26]  0.570426631 -1.454285246  0.929096258 -0.503689717  0.726747375
 [31]  0.384199906  0.856581305  0.776624254 -0.099939348 -0.022647672
 [36] -1.442888720  0.393745155 -0.500226030  0.603985011 -0.700539304
 [41] -0.470310132 -1.154660275 -0.915489880  1.686421744 -1.028382365
 [46]  0.048017883 -2.332944136 -0.823817281  0.668157321 -0.933094093
 [51] -0.239537811  1.654634131 -1.747093705 -1.869521152  1.017864475
 [56]  0.413650895  0.729694340  0.273210675 -0.256785156 -1.137965477
 [61]  0.490526105 -0.610131101 -0.444322331 -1.037809679  0.538822656
 [66] -0.671592427 -0.184117625  0.033751991  0.919894282  0.100434441
 [71] -0.291434812  1.196859587 -1.009437138  0.297735107 -0.088683118
 [76]  1.438345932  1.679206509 -2.054242313  0.369958178 -0.095042995
 [81]  1.347601261 -0.336466557  0.648407707  1.533622716  0.028851827
 [86]  1.113569213  0.474039020 -1.627750193  1.668862929 -0.515230821
 [91]  0.966061374  1.097170534 -0.094351311  0.834362346  1.860657269
 [96]  1.191904787  0.001809134  0.301975148 -0.095517649  0.925305367
> colSums(tmp)
  [1]  0.071633408  1.119865045 -0.123533003 -1.510213201 -0.866800812
  [6]  0.422602944 -1.468979075 -2.503098074  0.849017014  0.215459022
 [11]  0.839763686  0.430523972  1.411033207 -0.121618038 -0.085437995
 [16]  0.281621924  0.316050633  2.633650674 -0.665778350  1.423436400
 [21] -0.288244888  0.888212574 -0.556940346 -0.526688072  1.116797139
 [26]  0.570426631 -1.454285246  0.929096258 -0.503689717  0.726747375
 [31]  0.384199906  0.856581305  0.776624254 -0.099939348 -0.022647672
 [36] -1.442888720  0.393745155 -0.500226030  0.603985011 -0.700539304
 [41] -0.470310132 -1.154660275 -0.915489880  1.686421744 -1.028382365
 [46]  0.048017883 -2.332944136 -0.823817281  0.668157321 -0.933094093
 [51] -0.239537811  1.654634131 -1.747093705 -1.869521152  1.017864475
 [56]  0.413650895  0.729694340  0.273210675 -0.256785156 -1.137965477
 [61]  0.490526105 -0.610131101 -0.444322331 -1.037809679  0.538822656
 [66] -0.671592427 -0.184117625  0.033751991  0.919894282  0.100434441
 [71] -0.291434812  1.196859587 -1.009437138  0.297735107 -0.088683118
 [76]  1.438345932  1.679206509 -2.054242313  0.369958178 -0.095042995
 [81]  1.347601261 -0.336466557  0.648407707  1.533622716  0.028851827
 [86]  1.113569213  0.474039020 -1.627750193  1.668862929 -0.515230821
 [91]  0.966061374  1.097170534 -0.094351311  0.834362346  1.860657269
 [96]  1.191904787  0.001809134  0.301975148 -0.095517649  0.925305367
> 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.071633408  1.119865045 -0.123533003 -1.510213201 -0.866800812
  [6]  0.422602944 -1.468979075 -2.503098074  0.849017014  0.215459022
 [11]  0.839763686  0.430523972  1.411033207 -0.121618038 -0.085437995
 [16]  0.281621924  0.316050633  2.633650674 -0.665778350  1.423436400
 [21] -0.288244888  0.888212574 -0.556940346 -0.526688072  1.116797139
 [26]  0.570426631 -1.454285246  0.929096258 -0.503689717  0.726747375
 [31]  0.384199906  0.856581305  0.776624254 -0.099939348 -0.022647672
 [36] -1.442888720  0.393745155 -0.500226030  0.603985011 -0.700539304
 [41] -0.470310132 -1.154660275 -0.915489880  1.686421744 -1.028382365
 [46]  0.048017883 -2.332944136 -0.823817281  0.668157321 -0.933094093
 [51] -0.239537811  1.654634131 -1.747093705 -1.869521152  1.017864475
 [56]  0.413650895  0.729694340  0.273210675 -0.256785156 -1.137965477
 [61]  0.490526105 -0.610131101 -0.444322331 -1.037809679  0.538822656
 [66] -0.671592427 -0.184117625  0.033751991  0.919894282  0.100434441
 [71] -0.291434812  1.196859587 -1.009437138  0.297735107 -0.088683118
 [76]  1.438345932  1.679206509 -2.054242313  0.369958178 -0.095042995
 [81]  1.347601261 -0.336466557  0.648407707  1.533622716  0.028851827
 [86]  1.113569213  0.474039020 -1.627750193  1.668862929 -0.515230821
 [91]  0.966061374  1.097170534 -0.094351311  0.834362346  1.860657269
 [96]  1.191904787  0.001809134  0.301975148 -0.095517649  0.925305367
> colMin(tmp)
  [1]  0.071633408  1.119865045 -0.123533003 -1.510213201 -0.866800812
  [6]  0.422602944 -1.468979075 -2.503098074  0.849017014  0.215459022
 [11]  0.839763686  0.430523972  1.411033207 -0.121618038 -0.085437995
 [16]  0.281621924  0.316050633  2.633650674 -0.665778350  1.423436400
 [21] -0.288244888  0.888212574 -0.556940346 -0.526688072  1.116797139
 [26]  0.570426631 -1.454285246  0.929096258 -0.503689717  0.726747375
 [31]  0.384199906  0.856581305  0.776624254 -0.099939348 -0.022647672
 [36] -1.442888720  0.393745155 -0.500226030  0.603985011 -0.700539304
 [41] -0.470310132 -1.154660275 -0.915489880  1.686421744 -1.028382365
 [46]  0.048017883 -2.332944136 -0.823817281  0.668157321 -0.933094093
 [51] -0.239537811  1.654634131 -1.747093705 -1.869521152  1.017864475
 [56]  0.413650895  0.729694340  0.273210675 -0.256785156 -1.137965477
 [61]  0.490526105 -0.610131101 -0.444322331 -1.037809679  0.538822656
 [66] -0.671592427 -0.184117625  0.033751991  0.919894282  0.100434441
 [71] -0.291434812  1.196859587 -1.009437138  0.297735107 -0.088683118
 [76]  1.438345932  1.679206509 -2.054242313  0.369958178 -0.095042995
 [81]  1.347601261 -0.336466557  0.648407707  1.533622716  0.028851827
 [86]  1.113569213  0.474039020 -1.627750193  1.668862929 -0.515230821
 [91]  0.966061374  1.097170534 -0.094351311  0.834362346  1.860657269
 [96]  1.191904787  0.001809134  0.301975148 -0.095517649  0.925305367
> colMedians(tmp)
  [1]  0.071633408  1.119865045 -0.123533003 -1.510213201 -0.866800812
  [6]  0.422602944 -1.468979075 -2.503098074  0.849017014  0.215459022
 [11]  0.839763686  0.430523972  1.411033207 -0.121618038 -0.085437995
 [16]  0.281621924  0.316050633  2.633650674 -0.665778350  1.423436400
 [21] -0.288244888  0.888212574 -0.556940346 -0.526688072  1.116797139
 [26]  0.570426631 -1.454285246  0.929096258 -0.503689717  0.726747375
 [31]  0.384199906  0.856581305  0.776624254 -0.099939348 -0.022647672
 [36] -1.442888720  0.393745155 -0.500226030  0.603985011 -0.700539304
 [41] -0.470310132 -1.154660275 -0.915489880  1.686421744 -1.028382365
 [46]  0.048017883 -2.332944136 -0.823817281  0.668157321 -0.933094093
 [51] -0.239537811  1.654634131 -1.747093705 -1.869521152  1.017864475
 [56]  0.413650895  0.729694340  0.273210675 -0.256785156 -1.137965477
 [61]  0.490526105 -0.610131101 -0.444322331 -1.037809679  0.538822656
 [66] -0.671592427 -0.184117625  0.033751991  0.919894282  0.100434441
 [71] -0.291434812  1.196859587 -1.009437138  0.297735107 -0.088683118
 [76]  1.438345932  1.679206509 -2.054242313  0.369958178 -0.095042995
 [81]  1.347601261 -0.336466557  0.648407707  1.533622716  0.028851827
 [86]  1.113569213  0.474039020 -1.627750193  1.668862929 -0.515230821
 [91]  0.966061374  1.097170534 -0.094351311  0.834362346  1.860657269
 [96]  1.191904787  0.001809134  0.301975148 -0.095517649  0.925305367
> colRanges(tmp)
           [,1]     [,2]      [,3]      [,4]       [,5]      [,6]      [,7]
[1,] 0.07163341 1.119865 -0.123533 -1.510213 -0.8668008 0.4226029 -1.468979
[2,] 0.07163341 1.119865 -0.123533 -1.510213 -0.8668008 0.4226029 -1.468979
          [,8]     [,9]    [,10]     [,11]    [,12]    [,13]     [,14]
[1,] -2.503098 0.849017 0.215459 0.8397637 0.430524 1.411033 -0.121618
[2,] -2.503098 0.849017 0.215459 0.8397637 0.430524 1.411033 -0.121618
           [,15]     [,16]     [,17]    [,18]      [,19]    [,20]      [,21]
[1,] -0.08543799 0.2816219 0.3160506 2.633651 -0.6657784 1.423436 -0.2882449
[2,] -0.08543799 0.2816219 0.3160506 2.633651 -0.6657784 1.423436 -0.2882449
         [,22]      [,23]      [,24]    [,25]     [,26]     [,27]     [,28]
[1,] 0.8882126 -0.5569403 -0.5266881 1.116797 0.5704266 -1.454285 0.9290963
[2,] 0.8882126 -0.5569403 -0.5266881 1.116797 0.5704266 -1.454285 0.9290963
          [,29]     [,30]     [,31]     [,32]     [,33]       [,34]       [,35]
[1,] -0.5036897 0.7267474 0.3841999 0.8565813 0.7766243 -0.09993935 -0.02264767
[2,] -0.5036897 0.7267474 0.3841999 0.8565813 0.7766243 -0.09993935 -0.02264767
         [,36]     [,37]     [,38]    [,39]      [,40]      [,41]    [,42]
[1,] -1.442889 0.3937452 -0.500226 0.603985 -0.7005393 -0.4703101 -1.15466
[2,] -1.442889 0.3937452 -0.500226 0.603985 -0.7005393 -0.4703101 -1.15466
          [,43]    [,44]     [,45]      [,46]     [,47]      [,48]     [,49]
[1,] -0.9154899 1.686422 -1.028382 0.04801788 -2.332944 -0.8238173 0.6681573
[2,] -0.9154899 1.686422 -1.028382 0.04801788 -2.332944 -0.8238173 0.6681573
          [,50]      [,51]    [,52]     [,53]     [,54]    [,55]     [,56]
[1,] -0.9330941 -0.2395378 1.654634 -1.747094 -1.869521 1.017864 0.4136509
[2,] -0.9330941 -0.2395378 1.654634 -1.747094 -1.869521 1.017864 0.4136509
         [,57]     [,58]      [,59]     [,60]     [,61]      [,62]      [,63]
[1,] 0.7296943 0.2732107 -0.2567852 -1.137965 0.4905261 -0.6101311 -0.4443223
[2,] 0.7296943 0.2732107 -0.2567852 -1.137965 0.4905261 -0.6101311 -0.4443223
        [,64]     [,65]      [,66]      [,67]      [,68]     [,69]     [,70]
[1,] -1.03781 0.5388227 -0.6715924 -0.1841176 0.03375199 0.9198943 0.1004344
[2,] -1.03781 0.5388227 -0.6715924 -0.1841176 0.03375199 0.9198943 0.1004344
          [,71]   [,72]     [,73]     [,74]       [,75]    [,76]    [,77]
[1,] -0.2914348 1.19686 -1.009437 0.2977351 -0.08868312 1.438346 1.679207
[2,] -0.2914348 1.19686 -1.009437 0.2977351 -0.08868312 1.438346 1.679207
         [,78]     [,79]       [,80]    [,81]      [,82]     [,83]    [,84]
[1,] -2.054242 0.3699582 -0.09504299 1.347601 -0.3364666 0.6484077 1.533623
[2,] -2.054242 0.3699582 -0.09504299 1.347601 -0.3364666 0.6484077 1.533623
          [,85]    [,86]    [,87]    [,88]    [,89]      [,90]     [,91]
[1,] 0.02885183 1.113569 0.474039 -1.62775 1.668863 -0.5152308 0.9660614
[2,] 0.02885183 1.113569 0.474039 -1.62775 1.668863 -0.5152308 0.9660614
        [,92]       [,93]     [,94]    [,95]    [,96]       [,97]     [,98]
[1,] 1.097171 -0.09435131 0.8343623 1.860657 1.191905 0.001809134 0.3019751
[2,] 1.097171 -0.09435131 0.8343623 1.860657 1.191905 0.001809134 0.3019751
           [,99]    [,100]
[1,] -0.09551765 0.9253054
[2,] -0.09551765 0.9253054
> 
> 
> Max(tmp2)
[1] 2.5629
> Min(tmp2)
[1] -2.075273
> mean(tmp2)
[1] 0.0261286
> Sum(tmp2)
[1] 2.61286
> Var(tmp2)
[1] 0.80672
> 
> rowMeans(tmp2)
  [1]  0.76919515  0.28435173 -0.23505650  0.65434321 -0.88690535  0.49858747
  [7] -0.31805512 -1.00170838  0.04146569 -0.29449601  2.08220613  0.61612200
 [13]  0.03374992  0.88820194 -0.07011952 -1.14279996  0.18448776 -0.33676136
 [19]  0.54316405  0.81852996  0.87314284 -0.02977821 -0.31274740 -0.64687241
 [25] -0.96043691 -0.01956337  0.13426016  0.60223629 -0.08260404  0.95887665
 [31]  1.41197519 -0.93606184  0.20330453 -0.59854205 -1.06021165  0.89831605
 [37]  0.05463010  0.12725013  0.83847081  1.56569542  0.27726825  0.01272732
 [43]  2.56290036 -0.47472684 -1.08070993 -0.53883136 -0.55845349  0.50044550
 [49]  0.25944927  0.54480358  0.85605385 -0.54336767  2.01672349 -0.76439522
 [55]  0.13142137  0.47914032  0.06974256 -0.53688277  1.81735796 -0.95339493
 [61] -0.37956435  0.50245382 -0.41866832 -1.46067471  1.87192344 -0.08738063
 [67] -1.11524682 -1.22476035  0.92429310 -1.17470106 -0.98065889  0.77777449
 [73] -0.13811240 -1.70049747  0.19910169 -0.11587581 -0.88951820 -0.14530128
 [79] -2.07527335  0.65046079  0.31958977 -0.81018395  0.53670734 -0.52689118
 [85] -1.91046451  0.47108365  0.54095977  0.21263896 -0.15037217  0.40270411
 [91] -0.81297812 -0.14375618  0.96461440 -1.12346312 -0.30647413  0.79971513
 [97]  2.38439204 -0.65404785 -0.43125664 -0.39654523
> rowSums(tmp2)
  [1]  0.76919515  0.28435173 -0.23505650  0.65434321 -0.88690535  0.49858747
  [7] -0.31805512 -1.00170838  0.04146569 -0.29449601  2.08220613  0.61612200
 [13]  0.03374992  0.88820194 -0.07011952 -1.14279996  0.18448776 -0.33676136
 [19]  0.54316405  0.81852996  0.87314284 -0.02977821 -0.31274740 -0.64687241
 [25] -0.96043691 -0.01956337  0.13426016  0.60223629 -0.08260404  0.95887665
 [31]  1.41197519 -0.93606184  0.20330453 -0.59854205 -1.06021165  0.89831605
 [37]  0.05463010  0.12725013  0.83847081  1.56569542  0.27726825  0.01272732
 [43]  2.56290036 -0.47472684 -1.08070993 -0.53883136 -0.55845349  0.50044550
 [49]  0.25944927  0.54480358  0.85605385 -0.54336767  2.01672349 -0.76439522
 [55]  0.13142137  0.47914032  0.06974256 -0.53688277  1.81735796 -0.95339493
 [61] -0.37956435  0.50245382 -0.41866832 -1.46067471  1.87192344 -0.08738063
 [67] -1.11524682 -1.22476035  0.92429310 -1.17470106 -0.98065889  0.77777449
 [73] -0.13811240 -1.70049747  0.19910169 -0.11587581 -0.88951820 -0.14530128
 [79] -2.07527335  0.65046079  0.31958977 -0.81018395  0.53670734 -0.52689118
 [85] -1.91046451  0.47108365  0.54095977  0.21263896 -0.15037217  0.40270411
 [91] -0.81297812 -0.14375618  0.96461440 -1.12346312 -0.30647413  0.79971513
 [97]  2.38439204 -0.65404785 -0.43125664 -0.39654523
> 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.76919515  0.28435173 -0.23505650  0.65434321 -0.88690535  0.49858747
  [7] -0.31805512 -1.00170838  0.04146569 -0.29449601  2.08220613  0.61612200
 [13]  0.03374992  0.88820194 -0.07011952 -1.14279996  0.18448776 -0.33676136
 [19]  0.54316405  0.81852996  0.87314284 -0.02977821 -0.31274740 -0.64687241
 [25] -0.96043691 -0.01956337  0.13426016  0.60223629 -0.08260404  0.95887665
 [31]  1.41197519 -0.93606184  0.20330453 -0.59854205 -1.06021165  0.89831605
 [37]  0.05463010  0.12725013  0.83847081  1.56569542  0.27726825  0.01272732
 [43]  2.56290036 -0.47472684 -1.08070993 -0.53883136 -0.55845349  0.50044550
 [49]  0.25944927  0.54480358  0.85605385 -0.54336767  2.01672349 -0.76439522
 [55]  0.13142137  0.47914032  0.06974256 -0.53688277  1.81735796 -0.95339493
 [61] -0.37956435  0.50245382 -0.41866832 -1.46067471  1.87192344 -0.08738063
 [67] -1.11524682 -1.22476035  0.92429310 -1.17470106 -0.98065889  0.77777449
 [73] -0.13811240 -1.70049747  0.19910169 -0.11587581 -0.88951820 -0.14530128
 [79] -2.07527335  0.65046079  0.31958977 -0.81018395  0.53670734 -0.52689118
 [85] -1.91046451  0.47108365  0.54095977  0.21263896 -0.15037217  0.40270411
 [91] -0.81297812 -0.14375618  0.96461440 -1.12346312 -0.30647413  0.79971513
 [97]  2.38439204 -0.65404785 -0.43125664 -0.39654523
> rowMin(tmp2)
  [1]  0.76919515  0.28435173 -0.23505650  0.65434321 -0.88690535  0.49858747
  [7] -0.31805512 -1.00170838  0.04146569 -0.29449601  2.08220613  0.61612200
 [13]  0.03374992  0.88820194 -0.07011952 -1.14279996  0.18448776 -0.33676136
 [19]  0.54316405  0.81852996  0.87314284 -0.02977821 -0.31274740 -0.64687241
 [25] -0.96043691 -0.01956337  0.13426016  0.60223629 -0.08260404  0.95887665
 [31]  1.41197519 -0.93606184  0.20330453 -0.59854205 -1.06021165  0.89831605
 [37]  0.05463010  0.12725013  0.83847081  1.56569542  0.27726825  0.01272732
 [43]  2.56290036 -0.47472684 -1.08070993 -0.53883136 -0.55845349  0.50044550
 [49]  0.25944927  0.54480358  0.85605385 -0.54336767  2.01672349 -0.76439522
 [55]  0.13142137  0.47914032  0.06974256 -0.53688277  1.81735796 -0.95339493
 [61] -0.37956435  0.50245382 -0.41866832 -1.46067471  1.87192344 -0.08738063
 [67] -1.11524682 -1.22476035  0.92429310 -1.17470106 -0.98065889  0.77777449
 [73] -0.13811240 -1.70049747  0.19910169 -0.11587581 -0.88951820 -0.14530128
 [79] -2.07527335  0.65046079  0.31958977 -0.81018395  0.53670734 -0.52689118
 [85] -1.91046451  0.47108365  0.54095977  0.21263896 -0.15037217  0.40270411
 [91] -0.81297812 -0.14375618  0.96461440 -1.12346312 -0.30647413  0.79971513
 [97]  2.38439204 -0.65404785 -0.43125664 -0.39654523
> 
> colMeans(tmp2)
[1] 0.0261286
> colSums(tmp2)
[1] 2.61286
> colVars(tmp2)
[1] 0.80672
> colSd(tmp2)
[1] 0.8981759
> colMax(tmp2)
[1] 2.5629
> colMin(tmp2)
[1] -2.075273
> colMedians(tmp2)
[1] -0.003418025
> colRanges(tmp2)
          [,1]
[1,] -2.075273
[2,]  2.562900
> 
> 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] -0.4797245 -0.7757528  2.0992228  0.6530962  6.2578478 -1.9183544
 [7] -7.2387072 -2.6373784  1.0629071  1.5822609
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.49725438
[2,] -0.30821625
[3,] -0.08396127
[4,]  0.27796652
[5,]  1.02665034
> 
> rowApply(tmp,sum)
 [1] -0.29699515 -7.67810794  2.78411456  2.91798122 -1.05700879  1.67576211
 [7] -3.92885730 -0.34656610 -0.01150978  4.54660467
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    7    3    5    8    2    6    6    7    4     3
 [2,]    3    4    1    7    9    5   10    2    3     9
 [3,]    1    9    7   10    4    3    3   10    8     2
 [4,]    9    7    8    5    8    2    8    8    1     5
 [5,]    8   10   10    6   10    4    1    5   10     8
 [6,]    2    6    2    1    3    7    7    9    6     6
 [7,]    4    1    3    9    6    1    9    4    2     1
 [8,]   10    8    4    3    1    8    2    1    7     4
 [9,]    6    5    6    2    7   10    5    3    9     7
[10,]    5    2    9    4    5    9    4    6    5    10
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.3191770  0.6451610  1.6451343  1.2959267  1.5225950  0.6855633
 [7]  1.1092557  2.8909258  0.1484465  1.7820820 -1.6506818  0.7558434
[13] -2.6862734 -1.5766482 -0.5338907  1.0103206  1.4526506  2.2110240
[19]  4.2231981  1.9882757
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.6982799
[2,] -0.6670667
[3,]  0.2033623
[4,]  0.6828168
[5,]  1.7983445
> 
> rowApply(tmp,sum)
[1] -5.804743  5.724583 17.131716  2.133656 -0.947127
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    7   14   17   12    6
[2,]    2   19    8    9    9
[3,]   14    3   19   15    7
[4,]   17    4   18   14    4
[5,]    3    7    4   20   20
> 
> 
> as.matrix(tmp)
           [,1]        [,2]        [,3]       [,4]       [,5]        [,6]
[1,] -0.6982799 -1.30073669  0.01736835  0.1755552 -1.2844818 -0.03056481
[2,]  0.6828168  1.49591455 -0.94505415 -0.4418674 -0.2625931 -0.03094849
[3,]  1.7983445  0.58578576  1.96657879  1.8349511  0.1008723  1.61766897
[4,]  0.2033623 -0.01633983  1.01957422  0.7561960  1.7098894 -0.95503844
[5,] -0.6670667 -0.11946278 -0.41333290 -1.0289082  1.2589082  0.08444603
           [,7]        [,8]       [,9]      [,10]      [,11]      [,12]
[1,] -0.1392852 0.006843212  0.1065671  0.8277354 -0.8127851 -0.9662366
[2,]  0.8752777 1.274540611 -0.3035459 -1.1553847  0.3093341  2.0864743
[3,]  1.7247688 0.257977289  1.7614579 -0.4517066 -0.8696806  0.7711228
[4,] -0.5626170 0.162327468 -2.2847551  1.6126560  1.1804196 -0.7516232
[5,] -0.7888885 1.189237256  0.8687225  0.9487819 -1.4579699 -0.3838940
          [,13]      [,14]       [,15]       [,16]      [,17]        [,18]
[1,] -0.7423867 -0.3257518  0.80502323  0.17380704 -1.5006658 -0.491343026
[2,] -0.3004580  0.5462951 -0.21634248 -1.43647266  1.1579289  1.342470442
[3,]  0.4431145  0.9670303 -1.77717989  1.51138841  0.3152543  1.474115565
[4,] -0.5741618 -1.6246359  0.62860850  0.03570986  1.1450142 -0.111281748
[5,] -1.5123813 -1.1395859  0.02599997  0.72588798  0.3351190 -0.002937263
          [,19]      [,20]
[1,]  0.8503258 -0.4754506
[2,]  0.6579588  0.3882387
[3,]  2.3989305  0.7009213
[4,] -0.5701563  1.1305079
[5,]  0.8861393  0.2440583
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  647  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  561  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1     col2      col3      col4       col5       col6       col7
row1 -1.223899 1.234947 0.9699891 -1.989324 0.06079405 -0.6190912 -0.2057098
         col8      col9     col10     col11       col12     col13     col14
row1 1.084046 0.8570108 -0.322732 0.8233766 0.001208873 0.4887142 -0.546988
         col15      col16      col17     col18   col19     col20
row1 -1.004788 -0.2955623 -0.3225074 -2.314758 1.21089 0.8108775
> tmp[,"col10"]
           col10
row1 -0.32273195
row2  0.70345953
row3  0.07199561
row4 -1.30201189
row5  0.51553430
> tmp[c("row1","row5"),]
           col1     col2       col3      col4       col5       col6       col7
row1 -1.2238994 1.234947  0.9699891 -1.989324 0.06079405 -0.6190912 -0.2057098
row5  0.4471519 2.046461 -1.0492090 -1.426630 0.81387898 -1.0429114  1.1391628
           col8      col9      col10      col11       col12     col13     col14
row1  1.0840457 0.8570108 -0.3227320  0.8233766 0.001208873 0.4887142 -0.546988
row5 -0.9533678 1.2116824  0.5155343 -0.7111404 0.944126645 1.5429307 -3.023613
          col15      col16      col17      col18    col19      col20
row1 -1.0047882 -0.2955623 -0.3225074 -2.3147577 1.210890  0.8108775
row5 -0.5380532  1.1457548 -0.4243051 -0.1440524 1.177873 -0.6824539
> tmp[,c("col6","col20")]
           col6      col20
row1 -0.6190912  0.8108775
row2 -1.7255990  0.4387945
row3 -0.4844936  0.4819316
row4  0.4557170  0.5744018
row5 -1.0429114 -0.6824539
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -0.6190912  0.8108775
row5 -1.0429114 -0.6824539
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7    col8
row1 50.61858 51.19326 49.87303 51.32185 50.63014 104.7274 50.01521 50.9758
         col9    col10   col11    col12    col13   col14    col15    col16
row1 50.82384 50.55268 50.6013 52.17961 48.22354 51.0095 50.20738 50.06732
        col17    col18    col19    col20
row1 51.42237 49.74464 50.39399 105.4612
> tmp[,"col10"]
        col10
row1 50.55268
row2 28.56388
row3 29.93348
row4 28.93392
row5 50.20199
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.61858 51.19326 49.87303 51.32185 50.63014 104.7274 50.01521 50.97580
row5 49.88419 50.28066 47.90785 51.22430 49.43225 103.0556 49.48417 50.26694
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.82384 50.55268 50.60130 52.17961 48.22354 51.00950 50.20738 50.06732
row5 48.91756 50.20199 51.42497 50.81362 51.03445 52.15276 47.31386 50.34386
        col17    col18    col19    col20
row1 51.42237 49.74464 50.39399 105.4612
row5 48.90156 50.58748 49.08142 105.1212
> tmp[,c("col6","col20")]
          col6     col20
row1 104.72743 105.46120
row2  74.63664  74.85513
row3  74.06093  74.63929
row4  76.45990  76.22880
row5 103.05560 105.12121
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.7274 105.4612
row5 103.0556 105.1212
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.7274 105.4612
row5 103.0556 105.1212
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.5911602
[2,]  1.7605503
[3,]  1.7926922
[4,] -1.2681527
[5,]  0.2837900
> tmp[,c("col17","col7")]
          col17       col7
[1,]  0.7501018 -0.6109692
[2,] -0.2516972 -0.6806790
[3,] -1.1917884  1.7737901
[4,]  1.2803822  0.2472310
[5,] -1.0494921 -0.4295332
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  0.8639920 -0.6365007
[2,]  1.2497729  1.0489793
[3,] -0.3628029  0.7299889
[4,]  0.8382213 -0.2913589
[5,]  0.8444762  0.1156631
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 0.863992
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
         col6
[1,] 0.863992
[2,] 1.249773
> 
> 
> 
> 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  0.001656607  1.1287755 -0.7169772 -0.7069009 -0.1036060 0.4034627
row1 -0.142542781 -0.7453146 -0.9434917 -0.5319992  0.9021058 0.5609782
           [,7]        [,8]       [,9]      [,10]         [,11]       [,12]
row3 0.28154526 -0.35332682  1.5198092  2.0554996 -4.575961e-05  0.02302036
row1 0.08635349 -0.04142623 -0.9051156 -0.6042949  3.733385e-01 -0.16619321
          [,13]    [,14]      [,15]      [,16]      [,17]      [,18]      [,19]
row3 -0.1998848 0.888408 -1.4089986 -0.1683414 -1.3721525  0.5646340 -0.1514714
row1  0.1628596 1.231993  0.1790188  0.9884762  0.3665107 -0.2259499 -1.0191074
          [,20]
row3 -0.5734677
row1 -0.8713764
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]       [,2]     [,3]      [,4]      [,5]      [,6]     [,7]
row2 1.090166 -0.0570018 1.819652 0.9515978 -1.463163 0.9523876 1.202884
          [,8]      [,9]      [,10]
row2 -1.454447 0.5567696 -0.3240561
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]     [,2]       [,3]      [,4]    [,5]       [,6]     [,7]
row5 1.393984 1.213779 -0.7990189 -1.418698 0.58654 0.07410797 0.914809
           [,8]     [,9]     [,10]     [,11]    [,12]      [,13]     [,14]
row5 -0.2737379 -2.52133 0.3966871 0.7265654 1.355574 -0.6878722 0.2547247
            [,15]    [,16]      [,17]   [,18]     [,19]    [,20]
row5 -0.002589894 1.043498 -0.9818277 1.22106 -1.181034 1.399907
> 
> 
> 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: 0x6219217928c0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5886a54e09d3f"
 [2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5886a4d60469a"
 [3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5886a65091519"
 [4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5886a45ab6f9d"
 [5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5886a415f63d2"
 [6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5886a6655e6dd"
 [7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5886a28fac1e7"
 [8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5886a7975cea9"
 [9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5886a1e7300ab"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5886a53474f44"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5886a7dde4b42"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5886a6b9f6dcb"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5886a1fee7a90"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5886a37d723cd"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5886a39379648"
> 
> 
> ### 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: 0x6219229c4a50>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6219229c4a50>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x6219229c4a50>
> rowMedians(tmp)
  [1]  0.5059744995 -0.3839682284 -0.0037338064  0.0385948668  0.1696587296
  [6] -0.3855176690  0.0431874199  0.1450783999  0.0097615173  0.4976310049
 [11] -0.2454597262 -0.2103576300  0.1619023903 -0.1359925802  0.0561008096
 [16] -0.3594746006 -0.3742095733 -0.1825558786  0.3062676524  0.1464255066
 [21]  0.6972840824  0.2177694065 -0.1436486580 -0.6554250513  0.1791151542
 [26]  0.1960681490 -0.1431261413 -0.2592293933 -0.1950648762 -0.0680994939
 [31]  0.0143208101  0.8044669297 -0.5267398688 -0.3404806678 -0.2863260124
 [36] -0.0757063612  0.3914973603 -0.0382817779  0.0237851241  0.0943127465
 [41] -0.2159629108  0.2757056316  0.0154372959  0.2977329777 -0.2489081527
 [46]  0.2878765400  0.3120540333 -0.0189405532  0.0065488781  0.1152287751
 [51] -0.3962289459 -0.1908622891 -0.1448310208 -0.1684261733 -0.0953049848
 [56] -0.7241798269  0.3326370386  0.1714772927 -0.3282609535 -0.3908047800
 [61]  0.0969074471 -0.1077183412  0.0651999005  0.1909411866 -0.6963240306
 [66] -0.3804033081  0.2538485539 -0.3566753495  0.1477230217 -0.0123929324
 [71]  0.5019776575  0.1305100008 -0.7121723681 -0.2962650486  0.3961674697
 [76]  0.1583837626 -0.5987990310 -0.3704126391 -0.0576359230 -0.0104604078
 [81] -0.0819254288  0.0227993208 -0.2271998603 -0.0221638792 -0.1233332708
 [86]  0.2263937846 -0.6695329662 -0.3527418963 -0.1282655188 -0.2372132214
 [91] -0.2644978248  0.6731833823 -0.0895272849  0.2942396085 -0.0657841809
 [96]  0.1558566445 -0.4418051934  0.0360731573 -0.2352694198  0.1413067290
[101] -0.1130591939 -0.3029848074  0.6075043125 -0.1894849488  0.1152784285
[106] -0.4128086904 -0.4395509478 -0.2898610785  0.2401331697  0.3028866333
[111] -0.2858063738  0.0706738944 -0.0192947883  0.0306364917  0.0835230660
[116]  0.4354016542  0.0551358803 -0.1220145668 -0.4401673232  0.3495642088
[121]  0.0918834461 -0.0092434405 -0.3823773297  0.0645488276  0.4392817586
[126]  0.1408380922 -0.0539609571  0.0681293658 -0.0132728187  0.0005733914
[131] -0.2654086184 -0.4009544606 -0.1169596910  0.3466256070 -0.1854570281
[136] -0.3485946465  0.3843486301 -0.2431074171  0.5725785302 -0.0816386079
[141] -0.3690152733 -0.0172131935 -0.0987276512  0.1180619628  0.0872565768
[146] -0.1935444514 -0.1145945907  0.1105996560  0.2410882137  0.0561015063
[151] -0.8568195310  0.0772934822 -0.4849314187 -0.1917733622  0.6569125229
[156]  0.0299414691 -0.3031701786 -0.0055753136 -0.0166224329 -0.3185852990
[161] -0.1743206673  0.2103420140  0.1351637335  0.1199184358  0.0681293601
[166] -0.1941942164  0.3933936914 -0.0906675389  0.2922470882  0.0964017809
[171]  0.0609971577 -0.1473323123  0.4331468113 -0.3134709032 -0.3656990694
[176]  0.1846174143  0.0082670349 -0.3893921707 -0.1768726779 -0.0970625526
[181] -0.0011248267 -0.0752436653  0.1692542139 -0.0391140012  0.1442202450
[186] -0.0689706899 -0.3560273574 -0.2904883719 -0.3171871665 -0.4330461722
[191]  0.3396592524  0.2926525282  0.0978906286 -0.1113940724 -0.1321599003
[196] -0.2652904053  0.1372286863  0.2086543620  0.2564779398 -0.0474151174
[201] -0.3320464625  0.3248960192 -0.2778870492  0.0207890402  0.3080000734
[206]  0.5230775359 -0.0620920405  0.1304842775  0.0202283046 -0.2747594241
[211] -0.3668755128  0.1998944867  0.0215179369 -0.5592692946  0.1755948421
[216] -0.8381034495  0.2319809763 -0.3404591422 -0.0982109434  0.1399082731
[221]  0.1630452690 -0.1346135575  0.0277246007 -0.4518134051  0.0580238530
[226]  0.1700010451  0.1083513448 -0.2952817105 -0.3290591617 -0.0912499554
> 
> proc.time()
   user  system elapsed 
  1.350   1.564   2.903 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x59266a415fe0>
> .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: 0x59266a415fe0>
> .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: 0x59266a415fe0>
> .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: 0x59266a415fe0>
> 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: 0x59266bb5c480>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59266bb5c480>
> .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: 0x59266bb5c480>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59266bb5c480>
> .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: 0x59266bb5c480>
> 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: 0x59266c4e0050>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59266c4e0050>
> .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: 0x59266c4e0050>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x59266c4e0050>
> .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: 0x59266c4e0050>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x59266c4e0050>
> .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: 0x59266c4e0050>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x59266c4e0050>
> .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: 0x59266c4e0050>
> 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: 0x59266c5300b0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x59266c5300b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59266c5300b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59266c5300b0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile589951161bb0e" "BufferedMatrixFile5899536e88af7"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile589951161bb0e" "BufferedMatrixFile5899536e88af7"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x592669c363f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x592669c363f0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x592669c363f0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x592669c363f0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x592669c363f0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x592669c363f0>
> .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: 0x59266c6be700>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59266c6be700>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x59266c6be700>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x59266c6be700>
> 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: 0x59266b12c4a0>
> .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: 0x59266b12c4a0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.268   0.048   0.305 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.260   0.036   0.284 

Example timings