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

This page was generated on 2024-03-28 11:36:15 -0400 (Thu, 28 Mar 2024).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 22.04.3 LTS)x86_64R Under development (unstable) (2024-03-18 r86148) -- "Unsuffered Consequences" 4708
palomino3Windows Server 2022 Datacenterx64R Under development (unstable) (2024-03-16 r86144 ucrt) -- "Unsuffered Consequences" 4446
lconwaymacOS 12.7.1 Montereyx86_64R Under development (unstable) (2024-03-18 r86148) -- "Unsuffered Consequences" 4471
kunpeng2Linux (openEuler 22.03 LTS-SP1)aarch64R Under development (unstable) (2024-03-19 r86153) -- "Unsuffered Consequences" 4426
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 247/2270HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.67.0  (landing page)
Ben Bolstad
Snapshot Date: 2024-03-27 14:00:18 -0400 (Wed, 27 Mar 2024)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 9250806
git_last_commit_date: 2023-10-24 09:37:50 -0400 (Tue, 24 Oct 2023)
nebbiolo1Linux (Ubuntu 22.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino3Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kunpeng2Linux (openEuler 22.03 LTS-SP1) / aarch64  OK    OK    OK  

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.67.0
Command: /home/biocbuild/bbs-3.19-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.19-bioc/R/site-library --timings BufferedMatrix_1.67.0.tar.gz
StartedAt: 2024-03-27 20:49:10 -0400 (Wed, 27 Mar 2024)
EndedAt: 2024-03-27 20:49:34 -0400 (Wed, 27 Mar 2024)
EllapsedTime: 24.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2024-03-18 r86148)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
    gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
    GNU Fortran (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
* running under: Ubuntu 22.04.4 LTS
* using session charset: UTF-8
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.67.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 11.4.0-1ubuntu1~22.04) 11.4.0’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
Note: information on .o files is not available
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘Rcodetesting.R’
  Running ‘c_code_level_tests.R’
  Running ‘objectTesting.R’
  Running ‘rawCalltesting.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE

Status: 2 NOTEs
See
  ‘/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/home/biocbuild/bbs-3.19-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
gcc -I"/home/biocbuild/bbs-3.19-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -I"/home/biocbuild/bbs-3.19-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -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){
      |       ^~~~~~~~~~~~~~~~~~~
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 -I"/home/biocbuild/bbs-3.19-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -I"/home/biocbuild/bbs-3.19-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -c init_package.c -o init_package.o
gcc -shared -L/home/biocbuild/bbs-3.19-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.19-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.19-bioc/R/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R Under development (unstable) (2024-03-18 r86148) -- "Unsuffered Consequences"
Copyright (C) 2024 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.285   0.037   0.311 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2024-03-18 r86148) -- "Unsuffered Consequences"
Copyright (C) 2024 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.19-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 471733 25.2    1025798 54.8   644020 34.4
Vcells 871903  6.7    8388608 64.0  2046929 15.7
> 
> 
> 
> 
> ##
> ## 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] "Wed Mar 27 20:49:25 2024"
> 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] "Wed Mar 27 20:49:25 2024"
> 
> 
> 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: 0x55c6ffdd1240>
> 
> 
> 
> 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] "Wed Mar 27 20:49:26 2024"
> 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] "Wed Mar 27 20:49:26 2024"
> 
> ColMode(tmp2)
<pointer: 0x55c6ffdd1240>
> 
> 
> 
> ### 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,] 101.8558409 -0.1749566  0.68086761  0.8640821
[2,]  -0.4036520 -0.2033412  0.33240695 -0.4668665
[3,]  -0.3182562  0.6295775  0.05397901  0.5381864
[4,]   0.6252805 -0.9463793 -0.64709669 -0.3177640
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]       [,3]      [,4]
[1,] 101.8558409 0.1749566 0.68086761 0.8640821
[2,]   0.4036520 0.2033412 0.33240695 0.4668665
[3,]   0.3182562 0.6295775 0.05397901 0.5381864
[4,]   0.6252805 0.9463793 0.64709669 0.3177640
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0923655 0.4182782 0.8251470 0.9295602
[2,]  0.6353361 0.4509337 0.5765474 0.6832763
[3,]  0.5641420 0.7934592 0.2323338 0.7336119
[4,]  0.7907468 0.9728203 0.8044232 0.5637056
> 
> 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.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 227.77950 29.35774 33.93234 35.15968
[2,]  31.75701 29.71268 31.09788 32.29963
[3,]  30.95968 33.56417 27.37732 32.87431
[4,]  33.53275 35.67458 33.69133 30.95482
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x55c7011530d0>
> exp(tmp5)
<pointer: 0x55c7011530d0>
> log(tmp5,2)
<pointer: 0x55c7011530d0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 474.0932
> Min(tmp5)
[1] 52.26901
> mean(tmp5)
[1] 71.71613
> Sum(tmp5)
[1] 14343.23
> Var(tmp5)
[1] 894.6939
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 86.36819 69.24963 69.65166 71.79798 68.24033 69.43233 71.50918 67.57305
 [9] 73.61084 69.72810
> rowSums(tmp5)
 [1] 1727.364 1384.993 1393.033 1435.960 1364.807 1388.647 1430.184 1351.461
 [9] 1472.217 1394.562
> rowVars(tmp5)
 [1] 8361.89036   69.10666   73.60978   86.18329   95.71377   85.57551
 [7]   62.91529   68.24295  100.92995   85.43471
> rowSd(tmp5)
 [1] 91.443372  8.313041  8.579614  9.283496  9.783341  9.250703  7.931916
 [8]  8.260929 10.046390  9.243090
> rowMax(tmp5)
 [1] 474.09318  90.78461  86.67261  95.15200  89.25669  83.58634  87.88001
 [8]  86.25566  86.74080  88.87848
> rowMin(tmp5)
 [1] 57.22143 57.42924 56.98230 52.90670 55.34964 53.53500 59.37429 54.06437
 [9] 52.26901 54.12190
> 
> colMeans(tmp5)
 [1] 108.49425  71.93159  65.51355  70.25888  68.21653  70.17238  70.31157
 [8]  68.38433  76.81323  73.74866  72.11412  68.77239  71.93725  70.47954
[15]  69.84720  67.42684  66.10861  60.23191  72.46562  71.09413
> colSums(tmp5)
 [1] 1084.9425  719.3159  655.1355  702.5888  682.1653  701.7238  703.1157
 [8]  683.8433  768.1323  737.4866  721.1412  687.7239  719.3725  704.7954
[15]  698.4720  674.2684  661.0861  602.3191  724.6562  710.9413
> colVars(tmp5)
 [1] 16573.19404   104.88542    51.38110    45.21250    51.19761    81.23882
 [7]    45.93679   125.65338    70.90069    48.58641    73.30396    21.08416
[13]    99.11587    92.39603    53.94833    93.37808   100.07455    44.42574
[19]    69.16690   106.86145
> colSd(tmp5)
 [1] 128.736918  10.241358   7.168061   6.724024   7.155251   9.013258
 [7]   6.777668  11.209522   8.420255   6.970395   8.561773   4.591749
[13]   9.955696   9.612285   7.344953   9.663233  10.003727   6.665263
[19]   8.316664  10.337381
> colMax(tmp5)
 [1] 474.09318  87.88001  79.14746  85.99178  81.20862  88.87848  80.85340
 [8]  95.15200  90.78461  86.25566  86.74080  76.74222  86.47336  83.05940
[15]  83.58634  82.89247  85.45994  71.44408  84.48396  86.67261
> colMin(tmp5)
 [1] 58.85713 61.10429 56.98230 62.53247 60.15124 57.66303 60.65540 54.12190
 [9] 66.54451 65.81154 60.41207 63.33899 53.85559 57.55301 58.33893 53.62927
[17] 54.06437 52.26901 60.66327 53.53500
> 
> 
> ### 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] 86.36819 69.24963 69.65166 71.79798 68.24033       NA 71.50918 67.57305
 [9] 73.61084 69.72810
> rowSums(tmp5)
 [1] 1727.364 1384.993 1393.033 1435.960 1364.807       NA 1430.184 1351.461
 [9] 1472.217 1394.562
> rowVars(tmp5)
 [1] 8361.89036   69.10666   73.60978   86.18329   95.71377   90.28210
 [7]   62.91529   68.24295  100.92995   85.43471
> rowSd(tmp5)
 [1] 91.443372  8.313041  8.579614  9.283496  9.783341  9.501689  7.931916
 [8]  8.260929 10.046390  9.243090
> rowMax(tmp5)
 [1] 474.09318  90.78461  86.67261  95.15200  89.25669        NA  87.88001
 [8]  86.25566  86.74080  88.87848
> rowMin(tmp5)
 [1] 57.22143 57.42924 56.98230 52.90670 55.34964       NA 59.37429 54.06437
 [9] 52.26901 54.12190
> 
> colMeans(tmp5)
 [1] 108.49425  71.93159  65.51355  70.25888  68.21653  70.17238  70.31157
 [8]  68.38433  76.81323  73.74866  72.11412  68.77239  71.93725  70.47954
[15]  69.84720  67.42684  66.10861  60.23191        NA  71.09413
> colSums(tmp5)
 [1] 1084.9425  719.3159  655.1355  702.5888  682.1653  701.7238  703.1157
 [8]  683.8433  768.1323  737.4866  721.1412  687.7239  719.3725  704.7954
[15]  698.4720  674.2684  661.0861  602.3191        NA  710.9413
> colVars(tmp5)
 [1] 16573.19404   104.88542    51.38110    45.21250    51.19761    81.23882
 [7]    45.93679   125.65338    70.90069    48.58641    73.30396    21.08416
[13]    99.11587    92.39603    53.94833    93.37808   100.07455    44.42574
[19]          NA   106.86145
> colSd(tmp5)
 [1] 128.736918  10.241358   7.168061   6.724024   7.155251   9.013258
 [7]   6.777668  11.209522   8.420255   6.970395   8.561773   4.591749
[13]   9.955696   9.612285   7.344953   9.663233  10.003727   6.665263
[19]         NA  10.337381
> colMax(tmp5)
 [1] 474.09318  87.88001  79.14746  85.99178  81.20862  88.87848  80.85340
 [8]  95.15200  90.78461  86.25566  86.74080  76.74222  86.47336  83.05940
[15]  83.58634  82.89247  85.45994  71.44408        NA  86.67261
> colMin(tmp5)
 [1] 58.85713 61.10429 56.98230 62.53247 60.15124 57.66303 60.65540 54.12190
 [9] 66.54451 65.81154 60.41207 63.33899 53.85559 57.55301 58.33893 53.62927
[17] 54.06437 52.26901       NA 53.53500
> 
> Max(tmp5,na.rm=TRUE)
[1] 474.0932
> Min(tmp5,na.rm=TRUE)
[1] 52.26901
> mean(tmp5,na.rm=TRUE)
[1] 71.72307
> Sum(tmp5,na.rm=TRUE)
[1] 14272.89
> Var(tmp5,na.rm=TRUE)
[1] 899.2029
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 86.36819 69.24963 69.65166 71.79798 68.24033 69.38484 71.50918 67.57305
 [9] 73.61084 69.72810
> rowSums(tmp5,na.rm=TRUE)
 [1] 1727.364 1384.993 1393.033 1435.960 1364.807 1318.312 1430.184 1351.461
 [9] 1472.217 1394.562
> rowVars(tmp5,na.rm=TRUE)
 [1] 8361.89036   69.10666   73.60978   86.18329   95.71377   90.28210
 [7]   62.91529   68.24295  100.92995   85.43471
> rowSd(tmp5,na.rm=TRUE)
 [1] 91.443372  8.313041  8.579614  9.283496  9.783341  9.501689  7.931916
 [8]  8.260929 10.046390  9.243090
> rowMax(tmp5,na.rm=TRUE)
 [1] 474.09318  90.78461  86.67261  95.15200  89.25669  83.58634  87.88001
 [8]  86.25566  86.74080  88.87848
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.22143 57.42924 56.98230 52.90670 55.34964 53.53500 59.37429 54.06437
 [9] 52.26901 54.12190
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 108.49425  71.93159  65.51355  70.25888  68.21653  70.17238  70.31157
 [8]  68.38433  76.81323  73.74866  72.11412  68.77239  71.93725  70.47954
[15]  69.84720  67.42684  66.10861  60.23191  72.70240  71.09413
> colSums(tmp5,na.rm=TRUE)
 [1] 1084.9425  719.3159  655.1355  702.5888  682.1653  701.7238  703.1157
 [8]  683.8433  768.1323  737.4866  721.1412  687.7239  719.3725  704.7954
[15]  698.4720  674.2684  661.0861  602.3191  654.3216  710.9413
> colVars(tmp5,na.rm=TRUE)
 [1] 16573.19404   104.88542    51.38110    45.21250    51.19761    81.23882
 [7]    45.93679   125.65338    70.90069    48.58641    73.30396    21.08416
[13]    99.11587    92.39603    53.94833    93.37808   100.07455    44.42574
[19]    77.18202   106.86145
> colSd(tmp5,na.rm=TRUE)
 [1] 128.736918  10.241358   7.168061   6.724024   7.155251   9.013258
 [7]   6.777668  11.209522   8.420255   6.970395   8.561773   4.591749
[13]   9.955696   9.612285   7.344953   9.663233  10.003727   6.665263
[19]   8.785330  10.337381
> colMax(tmp5,na.rm=TRUE)
 [1] 474.09318  87.88001  79.14746  85.99178  81.20862  88.87848  80.85340
 [8]  95.15200  90.78461  86.25566  86.74080  76.74222  86.47336  83.05940
[15]  83.58634  82.89247  85.45994  71.44408  84.48396  86.67261
> colMin(tmp5,na.rm=TRUE)
 [1] 58.85713 61.10429 56.98230 62.53247 60.15124 57.66303 60.65540 54.12190
 [9] 66.54451 65.81154 60.41207 63.33899 53.85559 57.55301 58.33893 53.62927
[17] 54.06437 52.26901 60.66327 53.53500
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 86.36819 69.24963 69.65166 71.79798 68.24033      NaN 71.50918 67.57305
 [9] 73.61084 69.72810
> rowSums(tmp5,na.rm=TRUE)
 [1] 1727.364 1384.993 1393.033 1435.960 1364.807    0.000 1430.184 1351.461
 [9] 1472.217 1394.562
> rowVars(tmp5,na.rm=TRUE)
 [1] 8361.89036   69.10666   73.60978   86.18329   95.71377         NA
 [7]   62.91529   68.24295  100.92995   85.43471
> rowSd(tmp5,na.rm=TRUE)
 [1] 91.443372  8.313041  8.579614  9.283496  9.783341        NA  7.931916
 [8]  8.260929 10.046390  9.243090
> rowMax(tmp5,na.rm=TRUE)
 [1] 474.09318  90.78461  86.67261  95.15200  89.25669        NA  87.88001
 [8]  86.25566  86.74080  88.87848
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.22143 57.42924 56.98230 52.90670 55.34964       NA 59.37429 54.06437
 [9] 52.26901 54.12190
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.77925  70.64666  64.96495  69.71567  67.27135  70.26760  71.38448
 [8]  68.44065  76.98647  73.89411  71.57989  69.15419  73.94632  69.11178
[15]  68.32063  67.96927  65.64365  60.57322       NaN  73.04515
> colSums(tmp5,na.rm=TRUE)
 [1] 1024.0133  635.8199  584.6846  627.4411  605.4421  632.4084  642.4603
 [8]  615.9658  692.8782  665.0470  644.2190  622.3877  665.5169  622.0060
[15]  614.8857  611.7235  590.7929  545.1590    0.0000  657.4063
> colVars(tmp5,na.rm=TRUE)
 [1] 18330.61682    99.42184    54.41792    47.54448    47.54689    91.29168
 [7]    38.72864   141.32437    79.42564    54.42172    79.25617    22.07972
[13]    66.09611    82.89939    34.47464   101.74018   110.15182    48.66836
[19]          NA    77.39648
> colSd(tmp5,na.rm=TRUE)
 [1] 135.390608   9.971050   7.376850   6.895251   6.895425   9.554668
 [7]   6.223234  11.887993   8.912106   7.377108   8.902593   4.698906
[13]   8.129952   9.104910   5.871511  10.086633  10.495324   6.976271
[19]         NA   8.797527
> colMax(tmp5,na.rm=TRUE)
 [1] 474.09318  87.88001  79.14746  85.99178  81.20862  88.87848  80.85340
 [8]  95.15200  90.78461  86.25566  86.74080  76.74222  86.47336  83.05940
[15]  80.32980  82.89247  85.45994  71.44408      -Inf  86.67261
> colMin(tmp5,na.rm=TRUE)
 [1] 58.85713 61.10429 56.98230 62.53247 60.15124 57.66303 63.48185 54.12190
 [9] 66.54451 65.81154 60.41207 63.33899 62.46995 57.55301 58.33893 53.62927
[17] 54.06437 52.26901      Inf 61.57813
> 
> 
> 
> 
> 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] 221.0717 210.6939 220.7339 272.7135 213.9229 247.4090 131.2120 383.6726
 [9] 225.8654 223.0103
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 221.0717 210.6939 220.7339 272.7135 213.9229 247.4090 131.2120 383.6726
 [9] 225.8654 223.0103
> 
> 
> 
> 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] -1.421085e-14 -1.136868e-13  5.684342e-14  0.000000e+00 -1.989520e-13
 [6] -1.705303e-13  5.684342e-14 -1.705303e-13  1.421085e-13 -1.421085e-13
[11]  0.000000e+00  1.705303e-13  0.000000e+00 -2.842171e-14  5.684342e-14
[16] -1.705303e-13 -2.273737e-13 -1.421085e-13  1.136868e-13  2.842171e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
3   15 
3   20 
1   17 
6   8 
1   16 
5   16 
6   5 
9   14 
6   15 
2   4 
3   13 
2   1 
8   20 
6   14 
1   12 
8   3 
7   13 
8   13 
5   8 
1   16 
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.354001
> Min(tmp)
[1] -2.672615
> mean(tmp)
[1] 0.0993358
> Sum(tmp)
[1] 9.93358
> Var(tmp)
[1] 0.8283716
> 
> rowMeans(tmp)
[1] 0.0993358
> rowSums(tmp)
[1] 9.93358
> rowVars(tmp)
[1] 0.8283716
> rowSd(tmp)
[1] 0.9101492
> rowMax(tmp)
[1] 2.354001
> rowMin(tmp)
[1] -2.672615
> 
> colMeans(tmp)
  [1]  1.713278515 -1.575964638  1.056691347 -2.272993842 -0.296305509
  [6]  1.009676244 -2.672614834  0.237449858 -0.801368061  0.828698402
 [11]  0.097315555  1.230757898  1.367920138  0.262177248 -1.235451751
 [16]  0.146982217  0.701966284  0.561562087 -0.841527259 -1.224304521
 [21]  0.415128281 -0.334676112  0.593310506 -0.140748527 -0.211388433
 [26] -0.252959330 -0.636465075 -1.061240957  0.534125745  0.514981640
 [31]  0.034202669 -0.728480617 -0.457400972  0.460809357 -0.690582516
 [36]  0.724958671  0.966738971  0.928863420 -0.199797971  1.826468501
 [41] -0.022616009  0.220776014  0.388809956  1.972102596  0.132674401
 [46]  0.826554303  1.041484168  0.711387380  0.755063732 -0.198676440
 [51]  0.397611119 -0.525336615  0.365045944  0.986256762  0.108286049
 [56]  1.709404303  0.516448035  1.437073767 -0.424479633  0.952013609
 [61] -1.003413822 -1.538449934  0.378230110 -0.866861254  0.728982549
 [66]  0.029176875  0.182514306 -0.812368225 -0.279263699  2.295849992
 [71] -1.682825886  0.009018416  0.271216418 -0.099046924  0.484563578
 [76] -1.109018472  0.094663370 -0.647679852 -0.468494340 -0.215747693
 [81]  2.354000556  0.522668908  0.184276104  0.051085555 -0.622908564
 [86]  0.354016728 -1.546502166 -0.045392643 -0.751334901  0.572459473
 [91] -1.144543675 -0.118034032  0.232861736  0.965617232  0.368624866
 [96] -0.165963414 -0.288297289  0.322505357  0.370600922  0.637117172
> colSums(tmp)
  [1]  1.713278515 -1.575964638  1.056691347 -2.272993842 -0.296305509
  [6]  1.009676244 -2.672614834  0.237449858 -0.801368061  0.828698402
 [11]  0.097315555  1.230757898  1.367920138  0.262177248 -1.235451751
 [16]  0.146982217  0.701966284  0.561562087 -0.841527259 -1.224304521
 [21]  0.415128281 -0.334676112  0.593310506 -0.140748527 -0.211388433
 [26] -0.252959330 -0.636465075 -1.061240957  0.534125745  0.514981640
 [31]  0.034202669 -0.728480617 -0.457400972  0.460809357 -0.690582516
 [36]  0.724958671  0.966738971  0.928863420 -0.199797971  1.826468501
 [41] -0.022616009  0.220776014  0.388809956  1.972102596  0.132674401
 [46]  0.826554303  1.041484168  0.711387380  0.755063732 -0.198676440
 [51]  0.397611119 -0.525336615  0.365045944  0.986256762  0.108286049
 [56]  1.709404303  0.516448035  1.437073767 -0.424479633  0.952013609
 [61] -1.003413822 -1.538449934  0.378230110 -0.866861254  0.728982549
 [66]  0.029176875  0.182514306 -0.812368225 -0.279263699  2.295849992
 [71] -1.682825886  0.009018416  0.271216418 -0.099046924  0.484563578
 [76] -1.109018472  0.094663370 -0.647679852 -0.468494340 -0.215747693
 [81]  2.354000556  0.522668908  0.184276104  0.051085555 -0.622908564
 [86]  0.354016728 -1.546502166 -0.045392643 -0.751334901  0.572459473
 [91] -1.144543675 -0.118034032  0.232861736  0.965617232  0.368624866
 [96] -0.165963414 -0.288297289  0.322505357  0.370600922  0.637117172
> 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]  1.713278515 -1.575964638  1.056691347 -2.272993842 -0.296305509
  [6]  1.009676244 -2.672614834  0.237449858 -0.801368061  0.828698402
 [11]  0.097315555  1.230757898  1.367920138  0.262177248 -1.235451751
 [16]  0.146982217  0.701966284  0.561562087 -0.841527259 -1.224304521
 [21]  0.415128281 -0.334676112  0.593310506 -0.140748527 -0.211388433
 [26] -0.252959330 -0.636465075 -1.061240957  0.534125745  0.514981640
 [31]  0.034202669 -0.728480617 -0.457400972  0.460809357 -0.690582516
 [36]  0.724958671  0.966738971  0.928863420 -0.199797971  1.826468501
 [41] -0.022616009  0.220776014  0.388809956  1.972102596  0.132674401
 [46]  0.826554303  1.041484168  0.711387380  0.755063732 -0.198676440
 [51]  0.397611119 -0.525336615  0.365045944  0.986256762  0.108286049
 [56]  1.709404303  0.516448035  1.437073767 -0.424479633  0.952013609
 [61] -1.003413822 -1.538449934  0.378230110 -0.866861254  0.728982549
 [66]  0.029176875  0.182514306 -0.812368225 -0.279263699  2.295849992
 [71] -1.682825886  0.009018416  0.271216418 -0.099046924  0.484563578
 [76] -1.109018472  0.094663370 -0.647679852 -0.468494340 -0.215747693
 [81]  2.354000556  0.522668908  0.184276104  0.051085555 -0.622908564
 [86]  0.354016728 -1.546502166 -0.045392643 -0.751334901  0.572459473
 [91] -1.144543675 -0.118034032  0.232861736  0.965617232  0.368624866
 [96] -0.165963414 -0.288297289  0.322505357  0.370600922  0.637117172
> colMin(tmp)
  [1]  1.713278515 -1.575964638  1.056691347 -2.272993842 -0.296305509
  [6]  1.009676244 -2.672614834  0.237449858 -0.801368061  0.828698402
 [11]  0.097315555  1.230757898  1.367920138  0.262177248 -1.235451751
 [16]  0.146982217  0.701966284  0.561562087 -0.841527259 -1.224304521
 [21]  0.415128281 -0.334676112  0.593310506 -0.140748527 -0.211388433
 [26] -0.252959330 -0.636465075 -1.061240957  0.534125745  0.514981640
 [31]  0.034202669 -0.728480617 -0.457400972  0.460809357 -0.690582516
 [36]  0.724958671  0.966738971  0.928863420 -0.199797971  1.826468501
 [41] -0.022616009  0.220776014  0.388809956  1.972102596  0.132674401
 [46]  0.826554303  1.041484168  0.711387380  0.755063732 -0.198676440
 [51]  0.397611119 -0.525336615  0.365045944  0.986256762  0.108286049
 [56]  1.709404303  0.516448035  1.437073767 -0.424479633  0.952013609
 [61] -1.003413822 -1.538449934  0.378230110 -0.866861254  0.728982549
 [66]  0.029176875  0.182514306 -0.812368225 -0.279263699  2.295849992
 [71] -1.682825886  0.009018416  0.271216418 -0.099046924  0.484563578
 [76] -1.109018472  0.094663370 -0.647679852 -0.468494340 -0.215747693
 [81]  2.354000556  0.522668908  0.184276104  0.051085555 -0.622908564
 [86]  0.354016728 -1.546502166 -0.045392643 -0.751334901  0.572459473
 [91] -1.144543675 -0.118034032  0.232861736  0.965617232  0.368624866
 [96] -0.165963414 -0.288297289  0.322505357  0.370600922  0.637117172
> colMedians(tmp)
  [1]  1.713278515 -1.575964638  1.056691347 -2.272993842 -0.296305509
  [6]  1.009676244 -2.672614834  0.237449858 -0.801368061  0.828698402
 [11]  0.097315555  1.230757898  1.367920138  0.262177248 -1.235451751
 [16]  0.146982217  0.701966284  0.561562087 -0.841527259 -1.224304521
 [21]  0.415128281 -0.334676112  0.593310506 -0.140748527 -0.211388433
 [26] -0.252959330 -0.636465075 -1.061240957  0.534125745  0.514981640
 [31]  0.034202669 -0.728480617 -0.457400972  0.460809357 -0.690582516
 [36]  0.724958671  0.966738971  0.928863420 -0.199797971  1.826468501
 [41] -0.022616009  0.220776014  0.388809956  1.972102596  0.132674401
 [46]  0.826554303  1.041484168  0.711387380  0.755063732 -0.198676440
 [51]  0.397611119 -0.525336615  0.365045944  0.986256762  0.108286049
 [56]  1.709404303  0.516448035  1.437073767 -0.424479633  0.952013609
 [61] -1.003413822 -1.538449934  0.378230110 -0.866861254  0.728982549
 [66]  0.029176875  0.182514306 -0.812368225 -0.279263699  2.295849992
 [71] -1.682825886  0.009018416  0.271216418 -0.099046924  0.484563578
 [76] -1.109018472  0.094663370 -0.647679852 -0.468494340 -0.215747693
 [81]  2.354000556  0.522668908  0.184276104  0.051085555 -0.622908564
 [86]  0.354016728 -1.546502166 -0.045392643 -0.751334901  0.572459473
 [91] -1.144543675 -0.118034032  0.232861736  0.965617232  0.368624866
 [96] -0.165963414 -0.288297289  0.322505357  0.370600922  0.637117172
> colRanges(tmp)
         [,1]      [,2]     [,3]      [,4]       [,5]     [,6]      [,7]
[1,] 1.713279 -1.575965 1.056691 -2.272994 -0.2963055 1.009676 -2.672615
[2,] 1.713279 -1.575965 1.056691 -2.272994 -0.2963055 1.009676 -2.672615
          [,8]       [,9]     [,10]      [,11]    [,12]   [,13]     [,14]
[1,] 0.2374499 -0.8013681 0.8286984 0.09731556 1.230758 1.36792 0.2621772
[2,] 0.2374499 -0.8013681 0.8286984 0.09731556 1.230758 1.36792 0.2621772
         [,15]     [,16]     [,17]     [,18]      [,19]     [,20]     [,21]
[1,] -1.235452 0.1469822 0.7019663 0.5615621 -0.8415273 -1.224305 0.4151283
[2,] -1.235452 0.1469822 0.7019663 0.5615621 -0.8415273 -1.224305 0.4151283
          [,22]     [,23]      [,24]      [,25]      [,26]      [,27]     [,28]
[1,] -0.3346761 0.5933105 -0.1407485 -0.2113884 -0.2529593 -0.6364651 -1.061241
[2,] -0.3346761 0.5933105 -0.1407485 -0.2113884 -0.2529593 -0.6364651 -1.061241
         [,29]     [,30]      [,31]      [,32]     [,33]     [,34]      [,35]
[1,] 0.5341257 0.5149816 0.03420267 -0.7284806 -0.457401 0.4608094 -0.6905825
[2,] 0.5341257 0.5149816 0.03420267 -0.7284806 -0.457401 0.4608094 -0.6905825
         [,36]    [,37]     [,38]     [,39]    [,40]       [,41]    [,42]
[1,] 0.7249587 0.966739 0.9288634 -0.199798 1.826469 -0.02261601 0.220776
[2,] 0.7249587 0.966739 0.9288634 -0.199798 1.826469 -0.02261601 0.220776
       [,43]    [,44]     [,45]     [,46]    [,47]     [,48]     [,49]
[1,] 0.38881 1.972103 0.1326744 0.8265543 1.041484 0.7113874 0.7550637
[2,] 0.38881 1.972103 0.1326744 0.8265543 1.041484 0.7113874 0.7550637
          [,50]     [,51]      [,52]     [,53]     [,54]    [,55]    [,56]
[1,] -0.1986764 0.3976111 -0.5253366 0.3650459 0.9862568 0.108286 1.709404
[2,] -0.1986764 0.3976111 -0.5253366 0.3650459 0.9862568 0.108286 1.709404
        [,57]    [,58]      [,59]     [,60]     [,61]    [,62]     [,63]
[1,] 0.516448 1.437074 -0.4244796 0.9520136 -1.003414 -1.53845 0.3782301
[2,] 0.516448 1.437074 -0.4244796 0.9520136 -1.003414 -1.53845 0.3782301
          [,64]     [,65]      [,66]     [,67]      [,68]      [,69]   [,70]
[1,] -0.8668613 0.7289825 0.02917687 0.1825143 -0.8123682 -0.2792637 2.29585
[2,] -0.8668613 0.7289825 0.02917687 0.1825143 -0.8123682 -0.2792637 2.29585
         [,71]       [,72]     [,73]       [,74]     [,75]     [,76]      [,77]
[1,] -1.682826 0.009018416 0.2712164 -0.09904692 0.4845636 -1.109018 0.09466337
[2,] -1.682826 0.009018416 0.2712164 -0.09904692 0.4845636 -1.109018 0.09466337
          [,78]      [,79]      [,80]    [,81]     [,82]     [,83]      [,84]
[1,] -0.6476799 -0.4684943 -0.2157477 2.354001 0.5226689 0.1842761 0.05108555
[2,] -0.6476799 -0.4684943 -0.2157477 2.354001 0.5226689 0.1842761 0.05108555
          [,85]     [,86]     [,87]       [,88]      [,89]     [,90]     [,91]
[1,] -0.6229086 0.3540167 -1.546502 -0.04539264 -0.7513349 0.5724595 -1.144544
[2,] -0.6229086 0.3540167 -1.546502 -0.04539264 -0.7513349 0.5724595 -1.144544
         [,92]     [,93]     [,94]     [,95]      [,96]      [,97]     [,98]
[1,] -0.118034 0.2328617 0.9656172 0.3686249 -0.1659634 -0.2882973 0.3225054
[2,] -0.118034 0.2328617 0.9656172 0.3686249 -0.1659634 -0.2882973 0.3225054
         [,99]    [,100]
[1,] 0.3706009 0.6371172
[2,] 0.3706009 0.6371172
> 
> 
> Max(tmp2)
[1] 2.430543
> Min(tmp2)
[1] -2.091212
> mean(tmp2)
[1] 0.2984395
> Sum(tmp2)
[1] 29.84395
> Var(tmp2)
[1] 0.8531219
> 
> rowMeans(tmp2)
  [1] -0.05431999 -0.69682468  1.35989514 -0.13336264  0.59433736 -1.57756807
  [7]  1.03635665 -1.18683383  0.03872968  0.51375133  0.28275903 -0.44810751
 [13]  1.54194759 -1.26874116  0.27479350  0.68539631  0.66397926  0.33893535
 [19]  0.54368451 -0.46585939  0.61388429  1.28442296 -0.04936831 -0.44866047
 [25]  1.62134448 -0.73485757  0.72867857  0.78704358 -0.99964617  1.68852523
 [31] -1.06728798  0.46856396  0.85349210  1.59577663  0.07739266  2.43054298
 [37] -0.20729257  1.08336111  1.23158553 -0.75358758  0.75285432 -0.61150264
 [43]  1.25472198  0.33621479 -1.58553560 -0.43581665  1.63363275  0.26041916
 [49]  0.51798157  0.95197763  1.75311337 -1.70562773  2.25276354  0.54110103
 [55]  0.55796658  0.84406656 -1.00396123  0.45008801 -0.64496953  0.33607456
 [61] -2.09121236  0.19836621  0.40060434 -0.59544612  0.23416114  0.94973826
 [67]  0.92318839 -0.31982025  0.13574596 -0.34916108 -0.48172186  1.01724150
 [73] -0.59091517  0.47660163 -0.23300716  0.45830348  0.04074469  1.45123231
 [79]  0.22779693  1.31055023  0.28917382  1.12816662 -0.04714923  0.90870759
 [85]  1.87133524  0.42392850 -1.04264977  0.28423972 -1.54918723  0.09936715
 [91]  1.33189396  1.31590223 -0.35099335  0.99306995 -0.71060774  1.55563638
 [97]  0.10916935  0.23125762  1.36665015 -0.22937627
> rowSums(tmp2)
  [1] -0.05431999 -0.69682468  1.35989514 -0.13336264  0.59433736 -1.57756807
  [7]  1.03635665 -1.18683383  0.03872968  0.51375133  0.28275903 -0.44810751
 [13]  1.54194759 -1.26874116  0.27479350  0.68539631  0.66397926  0.33893535
 [19]  0.54368451 -0.46585939  0.61388429  1.28442296 -0.04936831 -0.44866047
 [25]  1.62134448 -0.73485757  0.72867857  0.78704358 -0.99964617  1.68852523
 [31] -1.06728798  0.46856396  0.85349210  1.59577663  0.07739266  2.43054298
 [37] -0.20729257  1.08336111  1.23158553 -0.75358758  0.75285432 -0.61150264
 [43]  1.25472198  0.33621479 -1.58553560 -0.43581665  1.63363275  0.26041916
 [49]  0.51798157  0.95197763  1.75311337 -1.70562773  2.25276354  0.54110103
 [55]  0.55796658  0.84406656 -1.00396123  0.45008801 -0.64496953  0.33607456
 [61] -2.09121236  0.19836621  0.40060434 -0.59544612  0.23416114  0.94973826
 [67]  0.92318839 -0.31982025  0.13574596 -0.34916108 -0.48172186  1.01724150
 [73] -0.59091517  0.47660163 -0.23300716  0.45830348  0.04074469  1.45123231
 [79]  0.22779693  1.31055023  0.28917382  1.12816662 -0.04714923  0.90870759
 [85]  1.87133524  0.42392850 -1.04264977  0.28423972 -1.54918723  0.09936715
 [91]  1.33189396  1.31590223 -0.35099335  0.99306995 -0.71060774  1.55563638
 [97]  0.10916935  0.23125762  1.36665015 -0.22937627
> 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.05431999 -0.69682468  1.35989514 -0.13336264  0.59433736 -1.57756807
  [7]  1.03635665 -1.18683383  0.03872968  0.51375133  0.28275903 -0.44810751
 [13]  1.54194759 -1.26874116  0.27479350  0.68539631  0.66397926  0.33893535
 [19]  0.54368451 -0.46585939  0.61388429  1.28442296 -0.04936831 -0.44866047
 [25]  1.62134448 -0.73485757  0.72867857  0.78704358 -0.99964617  1.68852523
 [31] -1.06728798  0.46856396  0.85349210  1.59577663  0.07739266  2.43054298
 [37] -0.20729257  1.08336111  1.23158553 -0.75358758  0.75285432 -0.61150264
 [43]  1.25472198  0.33621479 -1.58553560 -0.43581665  1.63363275  0.26041916
 [49]  0.51798157  0.95197763  1.75311337 -1.70562773  2.25276354  0.54110103
 [55]  0.55796658  0.84406656 -1.00396123  0.45008801 -0.64496953  0.33607456
 [61] -2.09121236  0.19836621  0.40060434 -0.59544612  0.23416114  0.94973826
 [67]  0.92318839 -0.31982025  0.13574596 -0.34916108 -0.48172186  1.01724150
 [73] -0.59091517  0.47660163 -0.23300716  0.45830348  0.04074469  1.45123231
 [79]  0.22779693  1.31055023  0.28917382  1.12816662 -0.04714923  0.90870759
 [85]  1.87133524  0.42392850 -1.04264977  0.28423972 -1.54918723  0.09936715
 [91]  1.33189396  1.31590223 -0.35099335  0.99306995 -0.71060774  1.55563638
 [97]  0.10916935  0.23125762  1.36665015 -0.22937627
> rowMin(tmp2)
  [1] -0.05431999 -0.69682468  1.35989514 -0.13336264  0.59433736 -1.57756807
  [7]  1.03635665 -1.18683383  0.03872968  0.51375133  0.28275903 -0.44810751
 [13]  1.54194759 -1.26874116  0.27479350  0.68539631  0.66397926  0.33893535
 [19]  0.54368451 -0.46585939  0.61388429  1.28442296 -0.04936831 -0.44866047
 [25]  1.62134448 -0.73485757  0.72867857  0.78704358 -0.99964617  1.68852523
 [31] -1.06728798  0.46856396  0.85349210  1.59577663  0.07739266  2.43054298
 [37] -0.20729257  1.08336111  1.23158553 -0.75358758  0.75285432 -0.61150264
 [43]  1.25472198  0.33621479 -1.58553560 -0.43581665  1.63363275  0.26041916
 [49]  0.51798157  0.95197763  1.75311337 -1.70562773  2.25276354  0.54110103
 [55]  0.55796658  0.84406656 -1.00396123  0.45008801 -0.64496953  0.33607456
 [61] -2.09121236  0.19836621  0.40060434 -0.59544612  0.23416114  0.94973826
 [67]  0.92318839 -0.31982025  0.13574596 -0.34916108 -0.48172186  1.01724150
 [73] -0.59091517  0.47660163 -0.23300716  0.45830348  0.04074469  1.45123231
 [79]  0.22779693  1.31055023  0.28917382  1.12816662 -0.04714923  0.90870759
 [85]  1.87133524  0.42392850 -1.04264977  0.28423972 -1.54918723  0.09936715
 [91]  1.33189396  1.31590223 -0.35099335  0.99306995 -0.71060774  1.55563638
 [97]  0.10916935  0.23125762  1.36665015 -0.22937627
> 
> colMeans(tmp2)
[1] 0.2984395
> colSums(tmp2)
[1] 29.84395
> colVars(tmp2)
[1] 0.8531219
> colSd(tmp2)
[1] 0.923646
> colMax(tmp2)
[1] 2.430543
> colMin(tmp2)
[1] -2.091212
> colMedians(tmp2)
[1] 0.3361447
> colRanges(tmp2)
          [,1]
[1,] -2.091212
[2,]  2.430543
> 
> 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]  1.856453 -2.635592  3.526368  1.207049 -1.271950 -1.134287  4.902460
 [8] -1.731351 -0.698034  3.025040
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.4802207
[2,] -0.5413310
[3,]  0.1495051
[4,]  0.9225734
[5,]  1.5430418
> 
> rowApply(tmp,sum)
 [1]  4.6817369  3.8590388  1.8286492 -4.3862375 -2.0669326  0.4135001
 [7] -0.9214540  2.3688027  0.7314069  0.5376458
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    5    9    4    9   10    3    3    9    1     4
 [2,]    2    7    1    3    6    1    7    2    8    10
 [3,]   10    6    7    7    8    2   10    5    2     8
 [4,]    4    4    2    4    5    9    4    7    6     6
 [5,]    3    2    8    2    2    6    9    1    9     9
 [6,]    1    3    5   10    3    5    2    8   10     7
 [7,]    7   10   10    6    7    7    6    6    5     2
 [8,]    8    1    6    1    4    8    5    3    7     3
 [9,]    6    8    3    5    1    4    8    4    4     5
[10,]    9    5    9    8    9   10    1   10    3     1
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -2.5106001 -0.3817959  5.3525020  3.4961560 -1.8461473  0.6066638
 [7]  1.1369664 -2.7347472 -1.4793899  1.5232368  1.4192434 -1.7470224
[13] -3.6135242 -1.7259064 -2.0068809  1.0852573  3.9336308  1.9956039
[19]  1.3300615 -1.4442868
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.9237985
[2,] -0.6854959
[3,] -0.6655892
[4,] -0.6410587
[5,]  0.4053423
> 
> rowApply(tmp,sum)
[1] -2.8707872 -2.2232227  2.9865955  0.4297994  4.0666358
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    7    7    4    6   13
[2,]   14    6   10   10   11
[3,]   12   17    7   20   20
[4,]   20   19    8   19    7
[5,]   19    4    6    3    9
> 
> 
> as.matrix(tmp)
           [,1]        [,2]       [,3]       [,4]       [,5]         [,6]
[1,] -0.6854959  0.40443602  0.0879219  1.3301489  1.3020890  0.248655559
[2,] -0.6410587 -0.65241334  0.7918969  1.3434296 -1.3330043 -0.005083735
[3,] -0.9237985 -0.03789595 -0.4737275 -0.4062025 -0.5165118  1.412093887
[4,] -0.6655892 -0.12975999  2.1427412  1.6172854 -1.0404149 -0.665504287
[5,]  0.4053423  0.03383740  2.8036695 -0.3885055 -0.2583054 -0.383497667
           [,7]        [,8]       [,9]        [,10]      [,11]      [,12]
[1,]  0.7175774 -1.03126410 -1.7091770 -0.318040764 -1.3716605  0.4490854
[2,]  0.3999476 -1.42673831  1.0306714  1.851023034 -0.4650252 -1.9278493
[3,] -1.0863419  0.20236809 -0.3422216  1.043222533  1.4270438  0.5887836
[4,]  0.8392862 -0.03753305  0.3779028 -1.044986681 -0.3674200 -1.5943786
[5,]  0.2664970 -0.44157981 -0.8365656 -0.007981369  2.1963052  0.7373365
           [,13]        [,14]      [,15]       [,16]      [,17]      [,18]
[1,] -0.63150439 -0.203615139 -0.7904020  0.76324390 -1.0322576 -0.6991294
[2,] -0.08518696  0.000738533  0.1880690 -0.66633350  0.3891148 -1.6108201
[3,] -0.72088446  0.165123398 -1.7601549 -0.96224211  2.0839633  2.9804612
[4,] -0.36466253 -0.857400133 -0.8335851 -0.05846936  0.7179301  0.8859342
[5,] -1.81128588 -0.830753061  1.1891921  2.00905837  1.7748801  0.4391580
          [,19]       [,20]
[1,] -0.1513273  0.44992876
[2,]  0.7464274 -0.15102766
[3,]  0.2584692  0.05504760
[4,]  1.4667792  0.04164397
[5,] -0.9902870 -1.83987945
> 
> 
> 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.19-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.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  654  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  565  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
           col1      col2      col3      col4       col5     col6      col7
row1 -0.1687895 0.3995764 0.8678538 0.2792613 -0.5697195 1.654112 0.7346743
           col8      col9     col10     col11     col12     col13     col14
row1 -0.4861671 0.3021208 0.5896845 0.3004523 -1.115783 0.2057328 0.3220835
          col15      col16       col17      col18      col19     col20
row1 -0.3119627 -0.6079042 -0.07661919 -0.4814981 -0.7208153 -1.264042
> tmp[,"col10"]
           col10
row1  0.58968448
row2  1.09083356
row3  0.22369331
row4  0.20749982
row5 -0.02612333
> tmp[c("row1","row5"),]
           col1       col2       col3       col4       col5      col6      col7
row1 -0.1687895  0.3995764  0.8678538  0.2792613 -0.5697195  1.654112 0.7346743
row5  0.1344235 -0.9275174 -1.5189912 -0.1656378  0.8482474 -2.156468 1.2200215
           col8       col9       col10      col11      col12     col13
row1 -0.4861671  0.3021208  0.58968448  0.3004523 -1.1157831 0.2057328
row5 -0.6740755 -0.3022513 -0.02612333 -2.6405305 -0.3275123 0.3056205
         col14      col15      col16       col17      col18      col19
row1 0.3220835 -0.3119627 -0.6079042 -0.07661919 -0.4814981 -0.7208153
row5 0.1221049 -0.6884565 -1.8034130  0.72583307  0.5766869  1.2798677
          col20
row1 -1.2640423
row5 -0.8944139
> tmp[,c("col6","col20")]
            col6      col20
row1  1.65411175 -1.2640423
row2 -0.07354717  0.1895382
row3 -0.38034718  1.4755063
row4 -1.30612767  0.1003543
row5 -2.15646762 -0.8944139
> tmp[c("row1","row5"),c("col6","col20")]
          col6      col20
row1  1.654112 -1.2640423
row5 -2.156468 -0.8944139
> 
> 
> 
> 
> 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.05374 48.50151 50.28174 51.53117 48.91448 104.082 50.11706 50.1178
         col9    col10    col11    col12   col13   col14    col15   col16
row1 50.53327 48.61238 50.29071 49.77229 50.1943 49.8261 48.67918 50.1978
        col17    col18    col19    col20
row1 51.00629 49.11221 50.85458 104.7155
> tmp[,"col10"]
        col10
row1 48.61238
row2 29.07039
row3 28.63987
row4 31.38293
row5 49.79842
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.05374 48.50151 50.28174 51.53117 48.91448 104.0820 50.11706 50.11780
row5 49.80464 50.24627 48.51868 48.93986 50.27006 105.1412 48.86384 52.27104
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.53327 48.61238 50.29071 49.77229 50.19430 49.82610 48.67918 50.19780
row5 50.23904 49.79842 50.11639 50.30451 49.14076 48.72486 50.03703 50.99952
        col17    col18    col19    col20
row1 51.00629 49.11221 50.85458 104.7155
row5 48.79305 49.74184 51.18365 104.4929
> tmp[,c("col6","col20")]
          col6     col20
row1 104.08195 104.71546
row2  74.16105  75.60716
row3  74.58789  77.01459
row4  75.58808  76.60234
row5 105.14125 104.49287
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.0820 104.7155
row5 105.1412 104.4929
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.0820 104.7155
row5 105.1412 104.4929
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.8360259
[2,] -0.8249702
[3,]  0.1639967
[4,] -0.4007516
[5,]  0.2183127
> tmp[,c("col17","col7")]
          col17         col7
[1,]  0.5557322  0.388689827
[2,]  0.9086763  0.001270262
[3,]  0.8522526  0.025059223
[4,]  0.5031926 -0.496595395
[5,] -0.3624985 -2.487038128
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.9312069  1.0506747
[2,] -1.5730644  0.2904529
[3,] -0.5185144  1.0597695
[4,]  0.2018226 -2.2324054
[5,]  0.3481039 -1.4060544
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.9312069
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.9312069
[2,] -1.5730644
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]       [,2]      [,3]      [,4]       [,5]         [,6]
row3 -1.273968 -1.2934491 0.1610124 -2.285797 -0.7964211 -0.003192139
row1 -1.893546 -0.4115057 1.1818053  1.594648 -2.0025332 -0.517236289
           [,7]       [,8]      [,9]     [,10]     [,11]     [,12]      [,13]
row3 0.45185023  0.8878188 0.4526914 -2.001896 0.1646280 0.9078968  0.3695702
row1 0.09661908 -0.7785472 0.6745115  0.759813 0.1881928 1.9650180 -0.1698925
         [,14]      [,15]     [,16]     [,17]       [,18]       [,19]
row3 0.3198826 -0.8319643 0.1544049 0.3753692  0.04441278  0.34093658
row1 0.3443747 -1.0370136 0.7288714 1.0231674 -1.36073629 -0.02125454
          [,20]
row3 -0.5634143
row1  0.5834470
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]       [,2]      [,3]      [,4]     [,5]     [,6]       [,7]
row2 1.385977 -0.7129176 -1.129317 -1.268033 1.939977 2.294986 -0.6442971
           [,8]      [,9]     [,10]
row2 -0.3151353 -1.127945 -2.109186
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]     [,2]     [,3]       [,4]       [,5]     [,6]       [,7]
row5 1.345293 0.148582 1.133535 -0.4495897 -0.5333647 -1.16665 -0.6385092
          [,8]      [,9]      [,10]      [,11]      [,12]     [,13]       [,14]
row5 0.7059176 -1.072618 -0.7405061 -0.9063735 -0.8603509 0.4392058 -0.06741133
        [,15]     [,16]      [,17]     [,18]     [,19]    [,20]
row5 0.951515 -0.588981 -0.3719432 0.7547068 0.4565875 0.201219
> 
> 
> 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: 0x55c6ffde54b0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM2dc8f312ec1066"
 [2] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM2dc8f37cb7ae2f"
 [3] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM2dc8f35f88a61b"
 [4] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM2dc8f3238ac8d8"
 [5] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM2dc8f341d18099"
 [6] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM2dc8f321780e6b"
 [7] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM2dc8f3268371a8"
 [8] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM2dc8f341d94625"
 [9] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM2dc8f3b3fcd0e" 
[10] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM2dc8f3537ef912"
[11] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM2dc8f3e6d9429" 
[12] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM2dc8f35be3446c"
[13] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM2dc8f3580e5b54"
[14] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM2dc8f372a4d27" 
[15] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM2dc8f32d0dcffa"
> 
> 
> ### 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: 0x55c7010cf750>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x55c7010cf750>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x55c7010cf750>
> rowMedians(tmp)
  [1]  0.179568863 -0.533273971  0.671875129 -0.496796087 -0.676492248
  [6] -0.113340187 -0.613413395 -0.163787859 -0.190422973 -0.076336219
 [11]  0.175715049 -0.166304967  0.320942058  0.066075654 -0.219731860
 [16]  0.365517838  0.212309459  0.478903525 -0.324489511 -0.152204154
 [21]  0.133056223 -0.005592004  0.207456717  0.301953079  0.122669950
 [26] -0.297605325 -0.023587668  0.172043557  0.126589612 -0.819631328
 [31]  0.071200592  0.296630671  0.273180499 -0.080207524 -0.119752885
 [36] -0.141727832 -0.183291037 -0.357897407 -0.126411262 -0.390527578
 [41]  0.136093957 -0.001930305  1.032089914 -0.245700317  0.038630260
 [46]  0.237219378  0.338216526 -0.179605629  0.166823391  0.036709905
 [51]  0.028321269  0.322800241 -0.209294525 -0.275412181  0.080831836
 [56]  0.122566071 -0.618408026 -0.020150113 -0.076805734 -0.438393176
 [61] -0.249293767 -0.260631675  0.573361846 -0.052861580 -0.463024585
 [66]  0.075061570  0.044987724 -0.274652047 -0.012177955 -0.079868269
 [71]  0.390646629 -0.291472389  0.376155082  0.504400138 -0.034385733
 [76] -0.391752359 -0.540460546 -0.344513620 -0.343554165 -0.448638169
 [81] -0.363448228  0.102785914 -0.104207224 -0.553985008 -0.332151240
 [86] -0.252207884 -0.515611575 -0.048639856  0.520441333 -0.234898802
 [91] -0.309993081 -0.298114075 -0.689505383 -0.139256193 -0.311049033
 [96]  0.100765534  0.392821037  0.061592165  0.051330968 -0.429470363
[101]  0.166765834 -0.157533348  0.857187634  0.567030903 -0.669173232
[106]  0.851145064  0.324096766  0.034071032  0.217008596 -0.035067706
[111]  0.253602437  0.035912845  0.344508182  0.303410891 -0.424067930
[116] -0.330119974  0.160546441 -0.304029693  0.436425770 -0.606785252
[121]  0.477098324  0.214596175 -0.592908548  0.351588664 -0.049866853
[126] -0.223467857 -0.151567857 -0.079549251 -0.042287705 -0.054988278
[131]  0.628883143  0.222126420  0.841564423 -0.007055723  0.470548245
[136]  0.108823424  0.223215021  0.226353313  0.570924191 -0.101290454
[141]  0.294753824  0.096695779  0.033836903  0.034825104  0.476872532
[146] -0.873776288  0.454551666  0.198069709 -0.100613467 -0.641522761
[151]  0.079733188  0.320287716  0.542549537 -0.227279575  0.412085500
[156]  0.064290414  0.069496463  0.140943714 -0.160958392  0.437549208
[161] -0.353666828  0.048406379 -0.129181319  0.507550931  0.250007018
[166]  0.403730342  0.107462556  0.454967327  0.426480080 -0.061077818
[171] -0.163244263 -0.018157893  0.445751341  0.134050341 -0.271688317
[176]  0.359014709 -0.562110776  0.460246423  0.054711626  0.011605830
[181] -0.242574006  0.368827450  0.258458325 -0.241758712 -0.009063432
[186] -0.471057868  0.121471370  0.925308589  0.467114608 -0.295332211
[191] -0.014408758 -0.035882753  0.319174152  0.031719504 -0.484468147
[196]  0.023337762 -0.466253368  0.191100061  0.413638033 -0.343291716
[201]  0.218979692 -0.052518331 -0.142314067 -0.523043757  0.365135568
[206] -0.222363413  0.135267576 -0.219117026 -0.097358263  0.110413410
[211]  0.054011066  0.032064978 -0.443302635  0.417714784  0.221017159
[216] -0.033484076 -0.017619078  0.034838602  0.288133245 -0.109535103
[221] -0.024613665  0.225750092  0.081023649 -0.547074640 -0.230993402
[226]  0.123836119  0.034331134 -0.280603286  0.372018511 -0.285498286
> 
> proc.time()
   user  system elapsed 
  1.287   1.536   2.840 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2024-03-18 r86148) -- "Unsuffered Consequences"
Copyright (C) 2024 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: 0x55d757c15240>
> .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: 0x55d757c15240>
> .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: 0x55d757c15240>
> .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: 0x55d757c15240>
> 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: 0x55d758b8cd60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55d758b8cd60>
> .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: 0x55d758b8cd60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55d758b8cd60>
> .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: 0x55d758b8cd60>
> 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: 0x55d75964f830>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55d75964f830>
> .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: 0x55d75964f830>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x55d75964f830>
> .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: 0x55d75964f830>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x55d75964f830>
> .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: 0x55d75964f830>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x55d75964f830>
> .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: 0x55d75964f830>
> 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: 0x55d759698cc0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x55d759698cc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55d759698cc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55d759698cc0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2dcba25fea3ba0" "BufferedMatrixFile2dcba2c68579a" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2dcba25fea3ba0" "BufferedMatrixFile2dcba2c68579a" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x55d758ee27a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55d758ee27a0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x55d758ee27a0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x55d758ee27a0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x55d758ee27a0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x55d758ee27a0>
> .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: 0x55d758ee4f80>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55d758ee4f80>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x55d758ee4f80>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x55d758ee4f80>
> 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: 0x55d758eeaa90>
> .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: 0x55d758eeaa90>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.250   0.057   0.297 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2024-03-18 r86148) -- "Unsuffered Consequences"
Copyright (C) 2024 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.258   0.041   0.288 

Example timings