Back to Build/check report for BioC 3.17
A[B]CDEFGHIJKLMNOPQRSTUVWXYZ

This page was generated on 2023-01-02 09:00:21 -0500 (Mon, 02 Jan 2023).

HostnameOSArch (*)R versionInstalled pkgs
palomino5Windows Server 2022 Datacenterx64R Under development (unstable) (2022-12-25 r83502 ucrt) -- "Unsuffered Consequences" 4165
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

CHECK results for BufferedMatrix on palomino5


To the developers/maintainers of the BufferedMatrix package:
Make sure to use the following settings in order to reproduce any error or warning you see on this page.

raw results

Package 227/2158HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.63.0  (landing page)
Ben Bolstad
Snapshot Date: 2022-12-28 11:00:06 -0500 (Wed, 28 Dec 2022)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: master
git_last_commit: e95ad0a
git_last_commit_date: 2022-11-01 10:42:48 -0500 (Tue, 01 Nov 2022)
palomino5Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  

Summary

Package: BufferedMatrix
Version: 1.63.0
Command: F:\biocbuild\bbs-3.17-bioc\R\bin\R.exe CMD check --no-multiarch --install=check:BufferedMatrix.install-out.txt --library=F:\biocbuild\bbs-3.17-bioc\R\library --no-vignettes --timings BufferedMatrix_1.63.0.tar.gz
StartedAt: 2022-12-28 22:09:15 -0500 (Wed, 28 Dec 2022)
EndedAt: 2022-12-28 22:10:55 -0500 (Wed, 28 Dec 2022)
EllapsedTime: 100.4 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

##############################################################################
##############################################################################
###
### Running command:
###
###   F:\biocbuild\bbs-3.17-bioc\R\bin\R.exe CMD check --no-multiarch --install=check:BufferedMatrix.install-out.txt --library=F:\biocbuild\bbs-3.17-bioc\R\library --no-vignettes --timings BufferedMatrix_1.63.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory 'F:/biocbuild/bbs-3.17-bioc-rtools43/meat/BufferedMatrix.Rcheck'
* using R Under development (unstable) (2022-12-25 r83502 ucrt)
* using platform: x86_64-w64-mingw32 (64-bit)
* R was compiled by
    gcc.exe (GCC) 10.4.0
    GNU Fortran (GCC) 10.4.0
* running under: Windows Server x64 (build 20348)
* using session charset: UTF-8
* using option '--no-vignettes'
* checking for file 'BufferedMatrix/DESCRIPTION' ... OK
* this is package 'BufferedMatrix' version '1.63.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 whether package 'BufferedMatrix' can be installed ... OK
* used C compiler: 'gcc.exe (GCC) 12.2.0'
* checking installed package size ... OK
* checking package directory ... OK
* checking 'build' directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R 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 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
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 for x64 is not available
File 'F:/biocbuild/bbs-3.17-bioc/R/library/BufferedMatrix/libs/x64/BufferedMatrix.dll':
  Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)

Compiled code should not call entry points which might terminate R nor
write to stdout/stderr instead of to the console, nor use Fortran I/O
nor system RNGs nor [v]sprintf. The detected symbols are linked into
the code but might come from libraries and not actually be called.

See 'Writing portable packages' in the 'Writing R Extensions' manual.
* checking sizes of PDF files under 'inst/doc' ... OK
* 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 in 'inst/doc' ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE

Status: 2 NOTEs
See
  'F:/biocbuild/bbs-3.17-bioc-rtools43/meat/BufferedMatrix.Rcheck/00check.log'
for details.



Installation output

BufferedMatrix.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   F:\biocbuild\bbs-3.17-bioc\R\bin\R.exe CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library 'F:/biocbuild/bbs-3.17-bioc/R/library'
* installing *source* package 'BufferedMatrix' ...
** using staged installation
** libs
using C compiler: 'gcc.exe (GCC) 12.2.0'
gcc  -I"F:/biocbuild/bbs-3.17-bioc/R/include" -DNDEBUG     -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc  -I"F:/biocbuild/bbs-3.17-bioc/R/include" -DNDEBUG     -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function 'dbm_ReadOnlyMode':
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of '!' or change '&' to '&&' or '!' to '~' [-Wparentheses]
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: 'sort_double' defined but not used [-Wunused-function]
 3327 | static int sort_double(const double *a1,const double *a2){
      |            ^~~~~~~~~~~
gcc  -I"F:/biocbuild/bbs-3.17-bioc/R/include" -DNDEBUG     -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc  -I"F:/biocbuild/bbs-3.17-bioc/R/include" -DNDEBUG     -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c init_package.c -o init_package.o
gcc -shared -s -static-libgcc -o BufferedMatrix.dll tmp.def RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -Lc:/rtools42/x86_64-w64-mingw32.static.posix/lib/x64 -Lc:/rtools42/x86_64-w64-mingw32.static.posix/lib -LF:/biocbuild/bbs-3.17-bioc/R/bin/x64 -lR
installing to F:/biocbuild/bbs-3.17-bioc/R/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs/x64
** 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
** 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) (2022-12-25 r83502 ucrt) -- "Unsuffered Consequences"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

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.28    0.12    0.62 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2022-12-25 r83502 ucrt) -- "Unsuffered Consequences"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

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] "F:/biocbuild/bbs-3.17-bioc-rtools43/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 453754 24.3     975562 52.2   641754 34.3
Vcells 824665  6.3    8388608 64.0  1993296 15.3
> 
> 
> 
> 
> ##
> ## 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 Dec 28 22:09:38 2022"
> 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 Dec 28 22:09:39 2022"
> 
> 
> 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: 0x000001a52ac778f0>
> 
> 
> 
> 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 Dec 28 22:10:01 2022"
> 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 Dec 28 22:10:09 2022"
> 
> ColMode(tmp2)
<pointer: 0x000001a52ac778f0>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]       [,3]        [,4]
[1,] 100.4149416  0.1503060  0.3675674 -1.86420861
[2,]   0.1308226  1.6056892  1.1509038  0.04140905
[3,]  -0.4633666 -1.2975514 -1.4845682 -0.22760725
[4,]  -0.5337812  0.8332684 -0.1682810  1.41752372
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.17-bioc-rtools43/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]       [,4]
[1,] 100.4149416 0.1503060 0.3675674 1.86420861
[2,]   0.1308226 1.6056892 1.1509038 0.04140905
[3,]   0.4633666 1.2975514 1.4845682 0.22760725
[4,]   0.5337812 0.8332684 0.1682810 1.41752372
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.17-bioc-rtools43/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.0207256 0.3876931 0.6062734 1.3653603
[2,]  0.3616940 1.2671579 1.0728019 0.2034921
[3,]  0.6807104 1.1391011 1.2184286 0.4770820
[4,]  0.7306033 0.9128354 0.4102206 1.1905981
> 
> 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:    F:/biocbuild/bbs-3.17-bioc-rtools43/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.62220 29.02724 31.43030 40.51781
[2,]  28.74776 39.27727 36.87892 27.07633
[3,]  32.27047 37.68856 38.66885 29.99843
[4,]  32.83981 34.96162 29.27049 38.32350
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x000001a52ac779d0>
> exp(tmp5)
<pointer: 0x000001a52ac779d0>
> log(tmp5,2)
<pointer: 0x000001a52ac779d0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.603
> Min(tmp5)
[1] 52.41473
> mean(tmp5)
[1] 73.74008
> Sum(tmp5)
[1] 14748.02
> Var(tmp5)
[1] 867.3454
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 93.27004 71.08147 71.11330 73.20872 67.43268 68.74433 72.08731 73.79907
 [9] 72.04345 74.62043
> rowSums(tmp5)
 [1] 1865.401 1421.629 1422.266 1464.174 1348.654 1374.887 1441.746 1475.981
 [9] 1440.869 1492.409
> rowVars(tmp5)
 [1] 7926.91835   91.68655   50.26797   89.14037   74.44556   71.78916
 [7]   71.49572   62.53561   66.43868   88.21612
> rowSd(tmp5)
 [1] 89.033243  9.575309  7.089991  9.441418  8.628184  8.472848  8.455514
 [8]  7.907946  8.150993  9.392344
> rowMax(tmp5)
 [1] 469.60304  86.52930  83.14212  94.42732  79.80259  88.26358  83.46834
 [8]  85.73359  85.72646  90.28332
> rowMin(tmp5)
 [1] 60.41639 56.35583 61.65990 60.19844 54.15945 52.41473 59.05012 58.55409
 [9] 60.44314 55.19533
> 
> colMeans(tmp5)
 [1] 109.98994  76.16676  72.35261  72.13643  71.85957  70.86850  69.47078
 [8]  70.59286  68.00964  69.54060  73.88145  71.48987  69.07282  73.04398
[15]  68.85044  72.90768  74.22051  71.92070  75.48890  72.93758
> colSums(tmp5)
 [1] 1099.8994  761.6676  723.5261  721.3643  718.5957  708.6850  694.7078
 [8]  705.9286  680.0964  695.4060  738.8145  714.8987  690.7282  730.4398
[15]  688.5044  729.0768  742.2051  719.2070  754.8890  729.3758
> colVars(tmp5)
 [1] 16043.16239    62.66089    54.71214   160.65872    72.17228    63.73814
 [7]    49.52130    66.34450    97.02668    53.96475    72.15738    95.95021
[13]   106.63774    70.71686    78.05306   126.93552    69.53253    61.69811
[19]    78.81491    55.71142
> colSd(tmp5)
 [1] 126.661606   7.915863   7.396765  12.675122   8.495427   7.983617
 [7]   7.037137   8.145213   9.850212   7.346070   8.494550   9.795418
[13]  10.326555   8.409332   8.834764  11.266566   8.338617   7.854814
[19]   8.877776   7.464009
> colMax(tmp5)
 [1] 469.60304  85.73359  81.54867  87.43793  84.81166  83.25946  79.96128
 [8]  86.52930  79.96226  80.90558  86.43463  94.42732  83.20207  83.03259
[15]  83.46834  91.58902  84.14025  84.02882  90.28332  81.69629
> colMin(tmp5)
 [1] 59.83470 60.41639 60.92268 54.15945 58.34849 58.63605 59.05027 61.24175
 [9] 52.41473 60.00540 62.08060 62.95743 55.19533 57.14773 54.61264 59.11837
[17] 59.05012 58.55409 60.19844 59.38015
> 
> 
> ### 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] 93.27004 71.08147 71.11330 73.20872 67.43268       NA 72.08731 73.79907
 [9] 72.04345 74.62043
> rowSums(tmp5)
 [1] 1865.401 1421.629 1422.266 1464.174 1348.654       NA 1441.746 1475.981
 [9] 1440.869 1492.409
> rowVars(tmp5)
 [1] 7926.91835   91.68655   50.26797   89.14037   74.44556   75.68743
 [7]   71.49572   62.53561   66.43868   88.21612
> rowSd(tmp5)
 [1] 89.033243  9.575309  7.089991  9.441418  8.628184  8.699853  8.455514
 [8]  7.907946  8.150993  9.392344
> rowMax(tmp5)
 [1] 469.60304  86.52930  83.14212  94.42732  79.80259        NA  83.46834
 [8]  85.73359  85.72646  90.28332
> rowMin(tmp5)
 [1] 60.41639 56.35583 61.65990 60.19844 54.15945       NA 59.05012 58.55409
 [9] 60.44314 55.19533
> 
> colMeans(tmp5)
 [1] 109.98994  76.16676        NA  72.13643  71.85957  70.86850  69.47078
 [8]  70.59286  68.00964  69.54060  73.88145  71.48987  69.07282  73.04398
[15]  68.85044  72.90768  74.22051  71.92070  75.48890  72.93758
> colSums(tmp5)
 [1] 1099.8994  761.6676        NA  721.3643  718.5957  708.6850  694.7078
 [8]  705.9286  680.0964  695.4060  738.8145  714.8987  690.7282  730.4398
[15]  688.5044  729.0768  742.2051  719.2070  754.8890  729.3758
> colVars(tmp5)
 [1] 16043.16239    62.66089          NA   160.65872    72.17228    63.73814
 [7]    49.52130    66.34450    97.02668    53.96475    72.15738    95.95021
[13]   106.63774    70.71686    78.05306   126.93552    69.53253    61.69811
[19]    78.81491    55.71142
> colSd(tmp5)
 [1] 126.661606   7.915863         NA  12.675122   8.495427   7.983617
 [7]   7.037137   8.145213   9.850212   7.346070   8.494550   9.795418
[13]  10.326555   8.409332   8.834764  11.266566   8.338617   7.854814
[19]   8.877776   7.464009
> colMax(tmp5)
 [1] 469.60304  85.73359        NA  87.43793  84.81166  83.25946  79.96128
 [8]  86.52930  79.96226  80.90558  86.43463  94.42732  83.20207  83.03259
[15]  83.46834  91.58902  84.14025  84.02882  90.28332  81.69629
> colMin(tmp5)
 [1] 59.83470 60.41639       NA 54.15945 58.34849 58.63605 59.05027 61.24175
 [9] 52.41473 60.00540 62.08060 62.95743 55.19533 57.14773 54.61264 59.11837
[17] 59.05012 58.55409 60.19844 59.38015
> 
> Max(tmp5,na.rm=TRUE)
[1] 469.603
> Min(tmp5,na.rm=TRUE)
[1] 52.41473
> mean(tmp5,na.rm=TRUE)
[1] 73.75895
> Sum(tmp5,na.rm=TRUE)
[1] 14678.03
> Var(tmp5,na.rm=TRUE)
[1] 871.6544
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 93.27004 71.08147 71.11330 73.20872 67.43268 68.67903 72.08731 73.79907
 [9] 72.04345 74.62043
> rowSums(tmp5,na.rm=TRUE)
 [1] 1865.401 1421.629 1422.266 1464.174 1348.654 1304.902 1441.746 1475.981
 [9] 1440.869 1492.409
> rowVars(tmp5,na.rm=TRUE)
 [1] 7926.91835   91.68655   50.26797   89.14037   74.44556   75.68743
 [7]   71.49572   62.53561   66.43868   88.21612
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.033243  9.575309  7.089991  9.441418  8.628184  8.699853  8.455514
 [8]  7.907946  8.150993  9.392344
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.60304  86.52930  83.14212  94.42732  79.80259  88.26358  83.46834
 [8]  85.73359  85.72646  90.28332
> rowMin(tmp5,na.rm=TRUE)
 [1] 60.41639 56.35583 61.65990 60.19844 54.15945 52.41473 59.05012 58.55409
 [9] 60.44314 55.19533
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.98994  76.16676  72.61568  72.13643  71.85957  70.86850  69.47078
 [8]  70.59286  68.00964  69.54060  73.88145  71.48987  69.07282  73.04398
[15]  68.85044  72.90768  74.22051  71.92070  75.48890  72.93758
> colSums(tmp5,na.rm=TRUE)
 [1] 1099.8994  761.6676  653.5411  721.3643  718.5957  708.6850  694.7078
 [8]  705.9286  680.0964  695.4060  738.8145  714.8987  690.7282  730.4398
[15]  688.5044  729.0768  742.2051  719.2070  754.8890  729.3758
> colVars(tmp5,na.rm=TRUE)
 [1] 16043.16239    62.66089    60.77258   160.65872    72.17228    63.73814
 [7]    49.52130    66.34450    97.02668    53.96475    72.15738    95.95021
[13]   106.63774    70.71686    78.05306   126.93552    69.53253    61.69811
[19]    78.81491    55.71142
> colSd(tmp5,na.rm=TRUE)
 [1] 126.661606   7.915863   7.795677  12.675122   8.495427   7.983617
 [7]   7.037137   8.145213   9.850212   7.346070   8.494550   9.795418
[13]  10.326555   8.409332   8.834764  11.266566   8.338617   7.854814
[19]   8.877776   7.464009
> colMax(tmp5,na.rm=TRUE)
 [1] 469.60304  85.73359  81.54867  87.43793  84.81166  83.25946  79.96128
 [8]  86.52930  79.96226  80.90558  86.43463  94.42732  83.20207  83.03259
[15]  83.46834  91.58902  84.14025  84.02882  90.28332  81.69629
> colMin(tmp5,na.rm=TRUE)
 [1] 59.83470 60.41639 60.92268 54.15945 58.34849 58.63605 59.05027 61.24175
 [9] 52.41473 60.00540 62.08060 62.95743 55.19533 57.14773 54.61264 59.11837
[17] 59.05012 58.55409 60.19844 59.38015
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 93.27004 71.08147 71.11330 73.20872 67.43268      NaN 72.08731 73.79907
 [9] 72.04345 74.62043
> rowSums(tmp5,na.rm=TRUE)
 [1] 1865.401 1421.629 1422.266 1464.174 1348.654    0.000 1441.746 1475.981
 [9] 1440.869 1492.409
> rowVars(tmp5,na.rm=TRUE)
 [1] 7926.91835   91.68655   50.26797   89.14037   74.44556         NA
 [7]   71.49572   62.53561   66.43868   88.21612
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.033243  9.575309  7.089991  9.441418  8.628184        NA  8.455514
 [8]  7.907946  8.150993  9.392344
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.60304  86.52930  83.14212  94.42732  79.80259        NA  83.46834
 [8]  85.73359  85.72646  90.28332
> rowMin(tmp5,na.rm=TRUE)
 [1] 60.41639 56.35583 61.65990 60.19844 54.15945       NA 59.05012 58.55409
 [9] 60.44314 55.19533
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.40397  77.24266       NaN  73.37525  72.73434  71.56216  69.09265
 [8]  70.70102  69.74241  70.60007  74.45063  72.37794  70.35453  72.24598
[15]  67.71909  73.68808  73.73780  71.94687  75.86198  73.45016
> colSums(tmp5,na.rm=TRUE)
 [1] 1011.6358  695.1840    0.0000  660.3772  654.6091  644.0595  621.8339
 [8]  636.3092  627.6816  635.4006  670.0557  651.4014  633.1908  650.2139
[15]  609.4718  663.1927  663.6402  647.5218  682.7578  661.0514
> colVars(tmp5,na.rm=TRUE)
 [1] 17982.99738    57.47074          NA   163.47595    72.58515    66.29230
 [7]    54.10292    74.50595    75.37710    48.08256    77.53237    99.07164
[13]   101.48612    72.39249    73.41009   135.95085    75.60275    69.40266
[19]    87.10090    59.71951
> colSd(tmp5,na.rm=TRUE)
 [1] 134.100699   7.580946         NA  12.785771   8.519692   8.142008
 [7]   7.355469   8.631683   8.681999   6.934159   8.805247   9.953474
[13]  10.074032   8.508378   8.567969  11.659796   8.694984   8.330826
[19]   9.332786   7.727840
> colMax(tmp5,na.rm=TRUE)
 [1] 469.60304  85.73359      -Inf  87.43793  84.81166  83.25946  79.96128
 [8]  86.52930  79.96226  80.90558  86.43463  94.42732  83.20207  83.03259
[15]  83.46834  91.58902  84.14025  84.02882  90.28332  81.69629
> colMin(tmp5,na.rm=TRUE)
 [1] 59.83470 60.41639      Inf 54.15945 58.34849 58.63605 59.05027 61.24175
 [9] 57.47129 62.37847 62.08060 62.95743 55.19533 57.14773 54.61264 59.11837
[17] 59.05012 58.55409 60.19844 59.38015
> 
> 
> 
> 
> 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] 192.64832 170.21320 244.16341 233.95987 210.68272  83.28207 222.90815
 [8] 194.60219 215.05084 285.67849
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 192.64832 170.21320 244.16341 233.95987 210.68272  83.28207 222.90815
 [8] 194.60219 215.05084 285.67849
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  0.000000e+00 -5.684342e-14  1.421085e-13  0.000000e+00  1.136868e-13
 [6]  9.947598e-14 -1.136868e-13  5.684342e-14  2.273737e-13 -1.989520e-13
[11] -5.684342e-14 -2.842171e-14 -2.273737e-13  0.000000e+00  1.705303e-13
[16]  2.842171e-14  2.842171e-14  1.705303e-13  0.000000e+00 -5.684342e-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)
+ }
9   19 
8   10 
10   12 
10   15 
3   14 
5   17 
10   19 
8   3 
8   14 
1   1 
7   12 
2   10 
6   12 
6   1 
5   8 
5   7 
7   10 
8   15 
6   8 
3   19 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.576775
> Min(tmp)
[1] -2.571205
> mean(tmp)
[1] -0.08291464
> Sum(tmp)
[1] -8.291464
> Var(tmp)
[1] 1.101951
> 
> rowMeans(tmp)
[1] -0.08291464
> rowSums(tmp)
[1] -8.291464
> rowVars(tmp)
[1] 1.101951
> rowSd(tmp)
[1] 1.049739
> rowMax(tmp)
[1] 2.576775
> rowMin(tmp)
[1] -2.571205
> 
> colMeans(tmp)
  [1] -0.570543084 -0.697764910  2.047992848  0.737072782  0.180694010
  [6]  0.039857886 -0.956469778 -1.567691780 -0.246714804 -1.604299748
 [11] -0.811600927 -0.419006171  0.666913063 -2.571204697 -1.957005836
 [16] -1.031674276  0.294806065 -1.265062412 -1.149824972 -2.450894471
 [21]  1.767318050  0.902957140  1.109781594 -0.643651765 -0.526687076
 [26]  0.354014265 -0.461831429 -1.908639885 -0.449308003 -1.735972739
 [31]  1.241472635 -0.476569730  1.032535868  1.812925909 -0.233766599
 [36] -1.547763672  1.045517940  0.419061919  0.408914842 -1.430074720
 [41] -1.301300896  0.775914787 -0.244585900  1.580859558  2.576775190
 [46]  0.043846918  0.916457251  1.100237447 -0.900172829  0.112525551
 [51]  1.373634846 -0.009947252 -0.982980702  0.997084312 -0.692532583
 [56]  0.216952524 -1.065301906  0.516320575 -1.048687990  0.791763605
 [61]  0.300965131  0.434959466 -1.201306724 -0.539892955  0.020318381
 [66]  0.597237529  0.129974651  0.251984374  0.670162197 -0.867892529
 [71] -0.167670628 -1.124278648 -0.450226131  0.312167882 -1.031629971
 [76]  0.304043700 -0.772078761  0.312672183  1.080883899  1.047611333
 [81]  0.387570886  0.741914442 -0.855876993  0.096759089 -0.470483508
 [86]  1.041830115  0.115112363 -1.529812550  1.097215480  0.034276537
 [91]  1.470885293  0.363058595 -2.145694293  0.095997183  0.039158521
 [96]  0.840000927 -1.864000625  1.213842297 -0.929755936  0.553857626
> colSums(tmp)
  [1] -0.570543084 -0.697764910  2.047992848  0.737072782  0.180694010
  [6]  0.039857886 -0.956469778 -1.567691780 -0.246714804 -1.604299748
 [11] -0.811600927 -0.419006171  0.666913063 -2.571204697 -1.957005836
 [16] -1.031674276  0.294806065 -1.265062412 -1.149824972 -2.450894471
 [21]  1.767318050  0.902957140  1.109781594 -0.643651765 -0.526687076
 [26]  0.354014265 -0.461831429 -1.908639885 -0.449308003 -1.735972739
 [31]  1.241472635 -0.476569730  1.032535868  1.812925909 -0.233766599
 [36] -1.547763672  1.045517940  0.419061919  0.408914842 -1.430074720
 [41] -1.301300896  0.775914787 -0.244585900  1.580859558  2.576775190
 [46]  0.043846918  0.916457251  1.100237447 -0.900172829  0.112525551
 [51]  1.373634846 -0.009947252 -0.982980702  0.997084312 -0.692532583
 [56]  0.216952524 -1.065301906  0.516320575 -1.048687990  0.791763605
 [61]  0.300965131  0.434959466 -1.201306724 -0.539892955  0.020318381
 [66]  0.597237529  0.129974651  0.251984374  0.670162197 -0.867892529
 [71] -0.167670628 -1.124278648 -0.450226131  0.312167882 -1.031629971
 [76]  0.304043700 -0.772078761  0.312672183  1.080883899  1.047611333
 [81]  0.387570886  0.741914442 -0.855876993  0.096759089 -0.470483508
 [86]  1.041830115  0.115112363 -1.529812550  1.097215480  0.034276537
 [91]  1.470885293  0.363058595 -2.145694293  0.095997183  0.039158521
 [96]  0.840000927 -1.864000625  1.213842297 -0.929755936  0.553857626
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -0.570543084 -0.697764910  2.047992848  0.737072782  0.180694010
  [6]  0.039857886 -0.956469778 -1.567691780 -0.246714804 -1.604299748
 [11] -0.811600927 -0.419006171  0.666913063 -2.571204697 -1.957005836
 [16] -1.031674276  0.294806065 -1.265062412 -1.149824972 -2.450894471
 [21]  1.767318050  0.902957140  1.109781594 -0.643651765 -0.526687076
 [26]  0.354014265 -0.461831429 -1.908639885 -0.449308003 -1.735972739
 [31]  1.241472635 -0.476569730  1.032535868  1.812925909 -0.233766599
 [36] -1.547763672  1.045517940  0.419061919  0.408914842 -1.430074720
 [41] -1.301300896  0.775914787 -0.244585900  1.580859558  2.576775190
 [46]  0.043846918  0.916457251  1.100237447 -0.900172829  0.112525551
 [51]  1.373634846 -0.009947252 -0.982980702  0.997084312 -0.692532583
 [56]  0.216952524 -1.065301906  0.516320575 -1.048687990  0.791763605
 [61]  0.300965131  0.434959466 -1.201306724 -0.539892955  0.020318381
 [66]  0.597237529  0.129974651  0.251984374  0.670162197 -0.867892529
 [71] -0.167670628 -1.124278648 -0.450226131  0.312167882 -1.031629971
 [76]  0.304043700 -0.772078761  0.312672183  1.080883899  1.047611333
 [81]  0.387570886  0.741914442 -0.855876993  0.096759089 -0.470483508
 [86]  1.041830115  0.115112363 -1.529812550  1.097215480  0.034276537
 [91]  1.470885293  0.363058595 -2.145694293  0.095997183  0.039158521
 [96]  0.840000927 -1.864000625  1.213842297 -0.929755936  0.553857626
> colMin(tmp)
  [1] -0.570543084 -0.697764910  2.047992848  0.737072782  0.180694010
  [6]  0.039857886 -0.956469778 -1.567691780 -0.246714804 -1.604299748
 [11] -0.811600927 -0.419006171  0.666913063 -2.571204697 -1.957005836
 [16] -1.031674276  0.294806065 -1.265062412 -1.149824972 -2.450894471
 [21]  1.767318050  0.902957140  1.109781594 -0.643651765 -0.526687076
 [26]  0.354014265 -0.461831429 -1.908639885 -0.449308003 -1.735972739
 [31]  1.241472635 -0.476569730  1.032535868  1.812925909 -0.233766599
 [36] -1.547763672  1.045517940  0.419061919  0.408914842 -1.430074720
 [41] -1.301300896  0.775914787 -0.244585900  1.580859558  2.576775190
 [46]  0.043846918  0.916457251  1.100237447 -0.900172829  0.112525551
 [51]  1.373634846 -0.009947252 -0.982980702  0.997084312 -0.692532583
 [56]  0.216952524 -1.065301906  0.516320575 -1.048687990  0.791763605
 [61]  0.300965131  0.434959466 -1.201306724 -0.539892955  0.020318381
 [66]  0.597237529  0.129974651  0.251984374  0.670162197 -0.867892529
 [71] -0.167670628 -1.124278648 -0.450226131  0.312167882 -1.031629971
 [76]  0.304043700 -0.772078761  0.312672183  1.080883899  1.047611333
 [81]  0.387570886  0.741914442 -0.855876993  0.096759089 -0.470483508
 [86]  1.041830115  0.115112363 -1.529812550  1.097215480  0.034276537
 [91]  1.470885293  0.363058595 -2.145694293  0.095997183  0.039158521
 [96]  0.840000927 -1.864000625  1.213842297 -0.929755936  0.553857626
> colMedians(tmp)
  [1] -0.570543084 -0.697764910  2.047992848  0.737072782  0.180694010
  [6]  0.039857886 -0.956469778 -1.567691780 -0.246714804 -1.604299748
 [11] -0.811600927 -0.419006171  0.666913063 -2.571204697 -1.957005836
 [16] -1.031674276  0.294806065 -1.265062412 -1.149824972 -2.450894471
 [21]  1.767318050  0.902957140  1.109781594 -0.643651765 -0.526687076
 [26]  0.354014265 -0.461831429 -1.908639885 -0.449308003 -1.735972739
 [31]  1.241472635 -0.476569730  1.032535868  1.812925909 -0.233766599
 [36] -1.547763672  1.045517940  0.419061919  0.408914842 -1.430074720
 [41] -1.301300896  0.775914787 -0.244585900  1.580859558  2.576775190
 [46]  0.043846918  0.916457251  1.100237447 -0.900172829  0.112525551
 [51]  1.373634846 -0.009947252 -0.982980702  0.997084312 -0.692532583
 [56]  0.216952524 -1.065301906  0.516320575 -1.048687990  0.791763605
 [61]  0.300965131  0.434959466 -1.201306724 -0.539892955  0.020318381
 [66]  0.597237529  0.129974651  0.251984374  0.670162197 -0.867892529
 [71] -0.167670628 -1.124278648 -0.450226131  0.312167882 -1.031629971
 [76]  0.304043700 -0.772078761  0.312672183  1.080883899  1.047611333
 [81]  0.387570886  0.741914442 -0.855876993  0.096759089 -0.470483508
 [86]  1.041830115  0.115112363 -1.529812550  1.097215480  0.034276537
 [91]  1.470885293  0.363058595 -2.145694293  0.095997183  0.039158521
 [96]  0.840000927 -1.864000625  1.213842297 -0.929755936  0.553857626
> colRanges(tmp)
           [,1]       [,2]     [,3]      [,4]     [,5]       [,6]       [,7]
[1,] -0.5705431 -0.6977649 2.047993 0.7370728 0.180694 0.03985789 -0.9564698
[2,] -0.5705431 -0.6977649 2.047993 0.7370728 0.180694 0.03985789 -0.9564698
          [,8]       [,9]   [,10]      [,11]      [,12]     [,13]     [,14]
[1,] -1.567692 -0.2467148 -1.6043 -0.8116009 -0.4190062 0.6669131 -2.571205
[2,] -1.567692 -0.2467148 -1.6043 -0.8116009 -0.4190062 0.6669131 -2.571205
         [,15]     [,16]     [,17]     [,18]     [,19]     [,20]    [,21]
[1,] -1.957006 -1.031674 0.2948061 -1.265062 -1.149825 -2.450894 1.767318
[2,] -1.957006 -1.031674 0.2948061 -1.265062 -1.149825 -2.450894 1.767318
         [,22]    [,23]      [,24]      [,25]     [,26]      [,27]    [,28]
[1,] 0.9029571 1.109782 -0.6436518 -0.5266871 0.3540143 -0.4618314 -1.90864
[2,] 0.9029571 1.109782 -0.6436518 -0.5266871 0.3540143 -0.4618314 -1.90864
         [,29]     [,30]    [,31]      [,32]    [,33]    [,34]      [,35]
[1,] -0.449308 -1.735973 1.241473 -0.4765697 1.032536 1.812926 -0.2337666
[2,] -0.449308 -1.735973 1.241473 -0.4765697 1.032536 1.812926 -0.2337666
         [,36]    [,37]     [,38]     [,39]     [,40]     [,41]     [,42]
[1,] -1.547764 1.045518 0.4190619 0.4089148 -1.430075 -1.301301 0.7759148
[2,] -1.547764 1.045518 0.4190619 0.4089148 -1.430075 -1.301301 0.7759148
          [,43]   [,44]    [,45]      [,46]     [,47]    [,48]      [,49]
[1,] -0.2445859 1.58086 2.576775 0.04384692 0.9164573 1.100237 -0.9001728
[2,] -0.2445859 1.58086 2.576775 0.04384692 0.9164573 1.100237 -0.9001728
         [,50]    [,51]        [,52]      [,53]     [,54]      [,55]     [,56]
[1,] 0.1125256 1.373635 -0.009947252 -0.9829807 0.9970843 -0.6925326 0.2169525
[2,] 0.1125256 1.373635 -0.009947252 -0.9829807 0.9970843 -0.6925326 0.2169525
         [,57]     [,58]     [,59]     [,60]     [,61]     [,62]     [,63]
[1,] -1.065302 0.5163206 -1.048688 0.7917636 0.3009651 0.4349595 -1.201307
[2,] -1.065302 0.5163206 -1.048688 0.7917636 0.3009651 0.4349595 -1.201307
         [,64]      [,65]     [,66]     [,67]     [,68]     [,69]      [,70]
[1,] -0.539893 0.02031838 0.5972375 0.1299747 0.2519844 0.6701622 -0.8678925
[2,] -0.539893 0.02031838 0.5972375 0.1299747 0.2519844 0.6701622 -0.8678925
          [,71]     [,72]      [,73]     [,74]    [,75]     [,76]      [,77]
[1,] -0.1676706 -1.124279 -0.4502261 0.3121679 -1.03163 0.3040437 -0.7720788
[2,] -0.1676706 -1.124279 -0.4502261 0.3121679 -1.03163 0.3040437 -0.7720788
         [,78]    [,79]    [,80]     [,81]     [,82]     [,83]      [,84]
[1,] 0.3126722 1.080884 1.047611 0.3875709 0.7419144 -0.855877 0.09675909
[2,] 0.3126722 1.080884 1.047611 0.3875709 0.7419144 -0.855877 0.09675909
          [,85]   [,86]     [,87]     [,88]    [,89]      [,90]    [,91]
[1,] -0.4704835 1.04183 0.1151124 -1.529813 1.097215 0.03427654 1.470885
[2,] -0.4704835 1.04183 0.1151124 -1.529813 1.097215 0.03427654 1.470885
         [,92]     [,93]      [,94]      [,95]     [,96]     [,97]    [,98]
[1,] 0.3630586 -2.145694 0.09599718 0.03915852 0.8400009 -1.864001 1.213842
[2,] 0.3630586 -2.145694 0.09599718 0.03915852 0.8400009 -1.864001 1.213842
          [,99]    [,100]
[1,] -0.9297559 0.5538576
[2,] -0.9297559 0.5538576
> 
> 
> Max(tmp2)
[1] 2.46358
> Min(tmp2)
[1] -2.637171
> mean(tmp2)
[1] -0.008858803
> Sum(tmp2)
[1] -0.8858803
> Var(tmp2)
[1] 1.057085
> 
> rowMeans(tmp2)
  [1] -0.98716373 -0.20635007 -0.41546194 -0.24642900 -0.89497612 -0.18597905
  [7] -1.50166787  2.35497709 -0.15581396  1.44389769  0.99467165  0.48754298
 [13] -0.75258882 -1.58444677 -1.54336751  0.34481776  1.48620969 -2.63717082
 [19] -1.11117604  0.61206132 -0.31938094 -0.06504965 -1.62664414 -1.35264966
 [25] -0.17714687 -1.55357378  0.90164244  0.80190601  0.20631124 -0.25478740
 [31] -1.92114419 -1.48440141 -0.60498667  0.46961826  1.06179674  0.76157705
 [37] -0.37732846 -0.52149591  2.01609483 -0.59324549 -0.67924397  1.55718246
 [43]  1.12849231  1.21406831  1.06850073 -0.29661966  0.56840792  0.98018404
 [49]  1.06916629  0.97431025  0.36124605  0.25692954 -1.03901363 -0.66485395
 [55] -0.78287094 -0.09132060 -0.16264397  0.60022904  0.96666759 -0.59218953
 [61]  0.98969391 -0.07690465 -0.15407423 -0.91272562  0.11322220  2.46358001
 [67] -1.38317713 -1.21767201 -0.46348832 -0.81503499 -0.77868394 -0.59698030
 [73]  0.55636413  2.10123982 -0.04081569 -0.68250804  0.14235884  1.13218082
 [79]  0.26046448 -1.02266570  1.18611568  0.92266784  1.00183107 -1.68856006
 [85] -0.48425511 -0.41524420 -1.30977823  1.51968423 -0.21461554  1.59168258
 [91]  0.41193826  0.28870030 -0.54544083 -1.37541984  0.79814621 -0.66040249
 [97]  0.59662766 -0.39778669  1.12931190 -0.16078340
> rowSums(tmp2)
  [1] -0.98716373 -0.20635007 -0.41546194 -0.24642900 -0.89497612 -0.18597905
  [7] -1.50166787  2.35497709 -0.15581396  1.44389769  0.99467165  0.48754298
 [13] -0.75258882 -1.58444677 -1.54336751  0.34481776  1.48620969 -2.63717082
 [19] -1.11117604  0.61206132 -0.31938094 -0.06504965 -1.62664414 -1.35264966
 [25] -0.17714687 -1.55357378  0.90164244  0.80190601  0.20631124 -0.25478740
 [31] -1.92114419 -1.48440141 -0.60498667  0.46961826  1.06179674  0.76157705
 [37] -0.37732846 -0.52149591  2.01609483 -0.59324549 -0.67924397  1.55718246
 [43]  1.12849231  1.21406831  1.06850073 -0.29661966  0.56840792  0.98018404
 [49]  1.06916629  0.97431025  0.36124605  0.25692954 -1.03901363 -0.66485395
 [55] -0.78287094 -0.09132060 -0.16264397  0.60022904  0.96666759 -0.59218953
 [61]  0.98969391 -0.07690465 -0.15407423 -0.91272562  0.11322220  2.46358001
 [67] -1.38317713 -1.21767201 -0.46348832 -0.81503499 -0.77868394 -0.59698030
 [73]  0.55636413  2.10123982 -0.04081569 -0.68250804  0.14235884  1.13218082
 [79]  0.26046448 -1.02266570  1.18611568  0.92266784  1.00183107 -1.68856006
 [85] -0.48425511 -0.41524420 -1.30977823  1.51968423 -0.21461554  1.59168258
 [91]  0.41193826  0.28870030 -0.54544083 -1.37541984  0.79814621 -0.66040249
 [97]  0.59662766 -0.39778669  1.12931190 -0.16078340
> 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.98716373 -0.20635007 -0.41546194 -0.24642900 -0.89497612 -0.18597905
  [7] -1.50166787  2.35497709 -0.15581396  1.44389769  0.99467165  0.48754298
 [13] -0.75258882 -1.58444677 -1.54336751  0.34481776  1.48620969 -2.63717082
 [19] -1.11117604  0.61206132 -0.31938094 -0.06504965 -1.62664414 -1.35264966
 [25] -0.17714687 -1.55357378  0.90164244  0.80190601  0.20631124 -0.25478740
 [31] -1.92114419 -1.48440141 -0.60498667  0.46961826  1.06179674  0.76157705
 [37] -0.37732846 -0.52149591  2.01609483 -0.59324549 -0.67924397  1.55718246
 [43]  1.12849231  1.21406831  1.06850073 -0.29661966  0.56840792  0.98018404
 [49]  1.06916629  0.97431025  0.36124605  0.25692954 -1.03901363 -0.66485395
 [55] -0.78287094 -0.09132060 -0.16264397  0.60022904  0.96666759 -0.59218953
 [61]  0.98969391 -0.07690465 -0.15407423 -0.91272562  0.11322220  2.46358001
 [67] -1.38317713 -1.21767201 -0.46348832 -0.81503499 -0.77868394 -0.59698030
 [73]  0.55636413  2.10123982 -0.04081569 -0.68250804  0.14235884  1.13218082
 [79]  0.26046448 -1.02266570  1.18611568  0.92266784  1.00183107 -1.68856006
 [85] -0.48425511 -0.41524420 -1.30977823  1.51968423 -0.21461554  1.59168258
 [91]  0.41193826  0.28870030 -0.54544083 -1.37541984  0.79814621 -0.66040249
 [97]  0.59662766 -0.39778669  1.12931190 -0.16078340
> rowMin(tmp2)
  [1] -0.98716373 -0.20635007 -0.41546194 -0.24642900 -0.89497612 -0.18597905
  [7] -1.50166787  2.35497709 -0.15581396  1.44389769  0.99467165  0.48754298
 [13] -0.75258882 -1.58444677 -1.54336751  0.34481776  1.48620969 -2.63717082
 [19] -1.11117604  0.61206132 -0.31938094 -0.06504965 -1.62664414 -1.35264966
 [25] -0.17714687 -1.55357378  0.90164244  0.80190601  0.20631124 -0.25478740
 [31] -1.92114419 -1.48440141 -0.60498667  0.46961826  1.06179674  0.76157705
 [37] -0.37732846 -0.52149591  2.01609483 -0.59324549 -0.67924397  1.55718246
 [43]  1.12849231  1.21406831  1.06850073 -0.29661966  0.56840792  0.98018404
 [49]  1.06916629  0.97431025  0.36124605  0.25692954 -1.03901363 -0.66485395
 [55] -0.78287094 -0.09132060 -0.16264397  0.60022904  0.96666759 -0.59218953
 [61]  0.98969391 -0.07690465 -0.15407423 -0.91272562  0.11322220  2.46358001
 [67] -1.38317713 -1.21767201 -0.46348832 -0.81503499 -0.77868394 -0.59698030
 [73]  0.55636413  2.10123982 -0.04081569 -0.68250804  0.14235884  1.13218082
 [79]  0.26046448 -1.02266570  1.18611568  0.92266784  1.00183107 -1.68856006
 [85] -0.48425511 -0.41524420 -1.30977823  1.51968423 -0.21461554  1.59168258
 [91]  0.41193826  0.28870030 -0.54544083 -1.37541984  0.79814621 -0.66040249
 [97]  0.59662766 -0.39778669  1.12931190 -0.16078340
> 
> colMeans(tmp2)
[1] -0.008858803
> colSums(tmp2)
[1] -0.8858803
> colVars(tmp2)
[1] 1.057085
> colSd(tmp2)
[1] 1.028146
> colMax(tmp2)
[1] 2.46358
> colMin(tmp2)
[1] -2.637171
> colMedians(tmp2)
[1] -0.1582987
> colRanges(tmp2)
          [,1]
[1,] -2.637171
[2,]  2.463580
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.04371892 -3.51411460 -1.12302199  3.80291888 -2.83176895  3.37296838
 [7]  0.12873854  5.31555591  0.68938817  3.99748757
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -2.45584004
[2,] -1.44731475
[3,]  0.06768714
[4,]  1.19127804
[5,]  2.25598570
> 
> rowApply(tmp,sum)
 [1]  1.1065767  2.0695002 -1.3779270 -2.1445398 -1.2205824 -0.4893368
 [7]  2.4130956  2.8088630  5.3920288  1.3241925
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    6    1    7    1    5   10   10   10   10     1
 [2,]    4    5    1   10    1    4    2    5    3     5
 [3,]    7    6    5    4    2    2    1    7    5     8
 [4,]    9    3    6    9    9    6    3    2    9     7
 [5,]    5    4    4    2    4    8    5    1    2     3
 [6,]    3   10    9    3    6    5    6    3    4     9
 [7,]   10    2    2    7   10    1    9    9    6     4
 [8,]    2    7   10    5    8    9    7    8    8     2
 [9,]    8    8    3    6    7    3    4    4    1    10
[10,]    1    9    8    8    3    7    8    6    7     6
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.862348138 -0.352121989  1.697868986 -1.382305141  3.532457558
 [6]  2.525667268  0.724700245  1.409048696  0.171078617  0.842491074
[11] -0.002031903 -2.418712142  1.099942158 -2.369379372  2.942403306
[16] -0.495108733 -1.572933040  2.228599929 -1.189084099 -5.584915530
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.5121566
[2,] -1.0988353
[3,] -0.5828824
[4,]  0.4716919
[5,]  0.8598343
> 
> rowApply(tmp,sum)
[1] -4.722591  2.637042  7.521902  2.092921 -7.583957
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   17    3    1   13    6
[2,]    5   17   20    6    1
[3,]   20    7   17   10    2
[4,]    2   20    3    5   14
[5,]    9   16   14   18   20
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]        [,4]       [,5]      [,6]
[1,]  0.8598343 -0.6406133  1.8761356 -1.71641482 -0.3822770 0.9057281
[2,] -0.5828824  0.6411495 -0.2147605  1.79128074  0.4828100 0.4386845
[3,] -1.5121566  2.1591387  1.4758605 -0.89069658  0.8309848 0.0694816
[4,]  0.4716919 -0.3220543  0.2839546 -0.61044971  1.1456831 0.3940295
[5,] -1.0988353 -2.1897426 -1.7233213  0.04397524  1.4552566 0.7177436
            [,7]        [,8]       [,9]      [,10]       [,11]      [,12]
[1,]  0.49513724 -0.59864011 -0.2360502 -0.4073023 -1.30193989 -1.3429679
[2,] -0.52057147  0.04539992  0.3299622  1.3894404 -0.09901632 -1.3519672
[3,]  0.82350044  0.45226475  0.5222442 -0.1757332  0.59699014  0.9433690
[4,] -0.14477559  0.56208620  0.7725687  0.1548561  0.63371392  0.5941196
[5,]  0.07140962  0.94793794 -1.2176463 -0.1187698  0.16822024 -1.2612657
          [,13]      [,14]      [,15]      [,16]      [,17]      [,18]
[1,]  1.2212260 -0.0597181 -0.4635180  0.2035531 -0.1537269  0.2238089
[2,]  0.3587251 -0.5696773  0.2426741  1.1941190  0.2513982 -0.2039683
[3,]  1.9248608 -0.6348240  1.0372925 -1.3269612  0.1176981  1.8177923
[4,] -1.9812993 -0.8921041  1.1576333  0.3180852 -0.7793449  1.4971013
[5,] -0.4235706 -0.2130559  0.9683213 -0.8839049 -1.0089575 -1.1061343
            [,19]      [,20]
[1,] -0.204196427 -3.0006487
[2,] -0.318862237 -0.6668961
[3,] -0.386187782 -0.3230168
[4,] -0.272762403 -0.8898119
[5,] -0.007075251 -0.7045420
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.17-bioc-rtools43/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.17-bioc-rtools43/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  679  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.17-bioc-rtools43/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  588  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.17-bioc-rtools43/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  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
row1 -0.5009465 -0.06162662 0.1682691 -0.3128538 0.07337178 -1.219785
           col7      col8       col9     col10     col11      col12    col13
row1 0.06647932 -1.580407 -0.1609404 -1.006945 -1.005598 -0.4132964 1.221922
      col14     col15     col16        col17    col18      col19      col20
row1 1.1632 -1.766938 -0.970222 9.371156e-05 1.580287 -0.2970555 -0.1985179
> tmp[,"col10"]
          col10
row1 -1.0069451
row2  0.7933408
row3  0.7996242
row4  0.9361613
row5 -0.3087235
> tmp[c("row1","row5"),]
           col1        col2      col3       col4       col5       col6
row1 -0.5009465 -0.06162662 0.1682691 -0.3128538 0.07337178 -1.2197850
row5 -1.6101506 -0.06184463 1.8854874  0.9597863 0.19804848 -0.5917559
            col7        col8       col9      col10      col11      col12
row1  0.06647932 -1.58040674 -0.1609404 -1.0069451 -1.0055981 -0.4132964
row5 -0.39007812 -0.02519524 -0.5687984 -0.3087235 -0.7343503  0.8507062
         col13      col14      col15     col16         col17      col18
row1 1.2219217  1.1632000 -1.7669381 -0.970222  9.371156e-05  1.5802873
row5 0.1924382 -0.9149388 -0.1937464 -2.051217 -8.217951e-01 -0.5695945
           col19       col20
row1 -0.29705549 -0.19851788
row5  0.06799963 -0.09882209
> tmp[,c("col6","col20")]
            col6        col20
row1 -1.21978498 -0.198517884
row2 -0.03087416 -1.733328958
row3 -0.20529676  0.312075055
row4  0.13527903 -0.002001225
row5 -0.59175592 -0.098822086
> tmp[c("row1","row5"),c("col6","col20")]
           col6       col20
row1 -1.2197850 -0.19851788
row5 -0.5917559 -0.09882209
> 
> 
> 
> 
> 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 49.2774 49.066 51.1591 49.33634 50.31307 105.4908 50.75615 50.72523
         col9   col10    col11    col12    col13    col14    col15    col16
row1 50.48602 50.3668 50.10763 48.15512 50.12267 50.35153 50.60167 47.79668
        col17    col18    col19    col20
row1 50.87033 50.67171 50.72089 103.6037
> tmp[,"col10"]
        col10
row1 50.36680
row2 30.39967
row3 30.06466
row4 28.51288
row5 49.79470
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.27740 49.06600 51.15910 49.33634 50.31307 105.4908 50.75615 50.72523
row5 50.76862 51.18114 49.77165 50.09283 48.86642 105.1921 50.81111 49.33602
         col9   col10    col11    col12    col13    col14    col15    col16
row1 50.48602 50.3668 50.10763 48.15512 50.12267 50.35153 50.60167 47.79668
row5 51.03530 49.7947 49.92825 50.18134 48.48977 48.68597 50.06444 50.89903
        col17    col18    col19    col20
row1 50.87033 50.67171 50.72089 103.6037
row5 50.84426 50.85322 49.25011 106.2499
> tmp[,c("col6","col20")]
          col6     col20
row1 105.49081 103.60370
row2  75.35157  77.14583
row3  74.87182  73.72580
row4  75.43197  74.77335
row5 105.19212 106.24989
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.4908 103.6037
row5 105.1921 106.2499
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.4908 103.6037
row5 105.1921 106.2499
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.2344077
[2,] -0.1047767
[3,] -0.5210945
[4,]  0.3614631
[5,] -0.7766923
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.2976284  1.8291191
[2,]  0.2083963  0.4536249
[3,]  2.2638750 -1.2796793
[4,] -0.8014480  0.8426548
[5,] -0.7605641 -0.2688751
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.8650127  0.7966175
[2,] -1.3984976  1.7326814
[3,]  0.1384276 -1.2059833
[4,] -1.4448800  1.2307045
[5,] -1.1505530 -0.1934109
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.8650127
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.8650127
[2,] -1.3984976
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]      [,3]       [,4]      [,5]      [,6]       [,7]
row3 -0.4966845 -0.3294354 -1.250707  0.9134441 0.3949310  1.021416 -0.9468323
row1 -0.5009578  1.1860201  2.536280 -0.4513368 0.2495861 -1.110513  0.7397280
           [,8]      [,9]      [,10]     [,11]      [,12]    [,13]      [,14]
row3 -1.2907094 0.6668029 -1.4112851  1.714120 -0.2925681 1.258132 -0.3266542
row1  0.9625585 0.6267581 -0.6908328 -0.231494 -2.5816774 1.280396 -0.2876458
         [,15]    [,16]      [,17]       [,18]    [,19]       [,20]
row3 1.1115767 1.080927  2.4958575 -0.52193415 1.674607 -0.08307978
row1 0.8498169 1.130703 -0.8385228  0.03347825 4.190021  0.67959135
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
            [,1]     [,2]      [,3]       [,4]      [,5]       [,6]       [,7]
row2 -0.01290847 1.456348 -0.573354 -0.6772938 0.7571471 -0.2736225 -0.8422254
           [,8]      [,9]      [,10]
row2 -0.2659923 -1.197424 -0.1165496
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]       [,3]      [,4]      [,5]      [,6]      [,7]
row5 0.9533804 0.1705866 -0.8883284 0.3105475 -1.470219 -1.088581 -0.234081
         [,8]      [,9]     [,10]      [,11]      [,12]   [,13]      [,14]
row5 -1.86844 -0.175082 -1.060031 -0.1569092 -0.9814598 1.30775 -0.8074657
         [,15]      [,16]     [,17]    [,18]     [,19]     [,20]
row5 0.2048239 -0.4343003 0.5806401 1.598204 -1.933774 -1.586284
> 
> 
> 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: 0x000001a52ba07230>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "F:/biocbuild/bbs-3.17-bioc-rtools43/meat/BufferedMatrix.Rcheck/tests\\BM286853d95073"
 [2] "F:/biocbuild/bbs-3.17-bioc-rtools43/meat/BufferedMatrix.Rcheck/tests\\BM286840b53ad9"
 [3] "F:/biocbuild/bbs-3.17-bioc-rtools43/meat/BufferedMatrix.Rcheck/tests\\BM286871581338"
 [4] "F:/biocbuild/bbs-3.17-bioc-rtools43/meat/BufferedMatrix.Rcheck/tests\\BM2868197e102d"
 [5] "F:/biocbuild/bbs-3.17-bioc-rtools43/meat/BufferedMatrix.Rcheck/tests\\BM28682b0357cf"
 [6] "F:/biocbuild/bbs-3.17-bioc-rtools43/meat/BufferedMatrix.Rcheck/tests\\BM2868691c701d"
 [7] "F:/biocbuild/bbs-3.17-bioc-rtools43/meat/BufferedMatrix.Rcheck/tests\\BM2868261857e8"
 [8] "F:/biocbuild/bbs-3.17-bioc-rtools43/meat/BufferedMatrix.Rcheck/tests\\BM286886833fc" 
 [9] "F:/biocbuild/bbs-3.17-bioc-rtools43/meat/BufferedMatrix.Rcheck/tests\\BM286858c81a8e"
[10] "F:/biocbuild/bbs-3.17-bioc-rtools43/meat/BufferedMatrix.Rcheck/tests\\BM28682ab41748"
[11] "F:/biocbuild/bbs-3.17-bioc-rtools43/meat/BufferedMatrix.Rcheck/tests\\BM28687997145a"
[12] "F:/biocbuild/bbs-3.17-bioc-rtools43/meat/BufferedMatrix.Rcheck/tests\\BM286868517981"
[13] "F:/biocbuild/bbs-3.17-bioc-rtools43/meat/BufferedMatrix.Rcheck/tests\\BM28687e0517e7"
[14] "F:/biocbuild/bbs-3.17-bioc-rtools43/meat/BufferedMatrix.Rcheck/tests\\BM28685255723b"
[15] "F:/biocbuild/bbs-3.17-bioc-rtools43/meat/BufferedMatrix.Rcheck/tests\\BM28686c6e2a85"
> 
> 
> ### 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: 0x000001a52ad59230>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x000001a52ad59230>
Warning message:
In dir.create(new.directory) :
  'F:\biocbuild\bbs-3.17-bioc-rtools43\meat\BufferedMatrix.Rcheck\tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x000001a52ad59230>
> rowMedians(tmp)
  [1] -0.079045394  0.252300589  0.204029945 -0.512269089 -0.057382975
  [6] -0.833957179  0.362549268 -0.034158143  0.268605068  0.337520969
 [11] -0.582753257 -0.170087977 -0.385734965  0.104222665  0.114930450
 [16] -0.143958968 -0.114446243 -0.360756083 -0.177855322 -0.091841103
 [21]  0.525059963  0.317225539 -0.418524618 -0.125883877 -0.273243436
 [26] -0.143344297  0.163853383  0.054547574 -0.245088761 -0.716590941
 [31] -0.518144873 -0.250814992 -0.852062860 -0.187044019 -0.109856254
 [36]  0.150552819  0.171731389  0.386166844 -0.936372366  0.032455888
 [41]  0.096914454 -0.277467108 -0.185103438 -0.162728679  0.206945250
 [46] -0.824634731 -0.108733726 -0.369059890 -0.149350005  0.410692644
 [51]  0.464736611  0.275046229 -0.358033152 -0.002768920  0.254430149
 [56] -0.263312122 -0.124664866  0.728462368  0.125218711  0.005656734
 [61] -0.122584285  0.002241557  0.016812582 -0.017993094 -0.371962489
 [66] -0.345496652  0.112858182  0.117054064 -0.186888335  0.226115639
 [71] -0.177594783  0.352855158 -0.190298850  0.446781552 -0.516404745
 [76]  0.237063113  0.344645439  0.556933252  0.145085502 -0.063677733
 [81]  0.176000979 -0.166865533  0.337593986 -0.236122840  0.122656692
 [86]  0.331255748  0.053949510  0.472922859  0.001236276 -0.523957310
 [91]  0.212679041  0.528846643  0.056343498  0.035183031 -0.277901676
 [96]  0.388613269  0.678186396 -0.044451898  0.004360032  0.071254746
[101]  0.161996914 -0.387022207 -0.337343577  0.373053623 -0.394748985
[106] -0.188806807  0.060657700  0.168953468 -0.305320988 -0.044708762
[111]  0.314371071  0.156579451  0.159660323 -0.531546636 -0.045742023
[116] -0.610107791  0.115058125 -0.332765267 -0.344175618  0.313797011
[121] -0.194064413 -0.272828091 -0.137660130  0.302005545 -0.189595761
[126]  0.070568383  0.253477246  0.257344707 -0.228530898  0.273349220
[131]  0.106218010 -0.622252144  0.616123648  0.137192106  0.164273152
[136]  0.277537731 -0.209348684 -0.421093785 -0.016558092  0.730088433
[141] -0.042784139  0.552060936 -0.658763891  0.255432790  0.394861062
[146]  0.045780852  0.320570169  0.183199546 -0.527680894  0.200936299
[151]  0.421974537 -0.622884038  0.278008233  0.150304484 -0.207732505
[156]  0.142793891 -0.515544924  0.057513989  0.031851444 -0.625620011
[161] -0.304498394  0.342187891  0.192137542 -0.060028985 -0.221986683
[166] -0.242699795 -0.004168864 -0.424534135 -0.160886214  0.086282252
[171]  0.189996921  0.176489988 -0.711067650  0.131057847 -0.442970214
[176] -0.069840523 -0.329025481 -0.230916600 -0.101551787  0.039956139
[181] -0.237725739 -0.300154236  0.154237170  0.184923205 -0.222383521
[186]  0.205054774  0.270796940  0.266191046 -0.203940491 -0.056258168
[191]  0.180587543  0.074120679  0.306185378  0.232219820 -0.396575700
[196] -0.179404877  0.066666291  0.058383472 -0.484832525  0.140388927
[201]  0.256683141  0.305268079  0.179928262  0.468497188 -0.349926791
[206]  0.140866274  0.037273973  0.125066915  0.159732371 -0.123786704
[211] -0.067013829  0.065328744  0.235288170  0.245051027  0.069382368
[216] -0.061403826  0.291507322 -0.285635817  0.825623558 -0.395672094
[221] -0.408560165 -0.303693873 -0.303831250 -0.458118939 -0.022335092
[226] -0.172799839  0.546912660  0.224506275  0.051160328 -0.384666469
> 
> proc.time()
   user  system elapsed 
   2.96   16.84   69.28 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2022-12-25 r83502 ucrt) -- "Unsuffered Consequences"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

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: 0x000001a8d0d40d00>
> .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: 0x000001a8d0d40d00>
> .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: 0x000001a8d0d40d00>
> .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: 0x000001a8d0d40d00>
> 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: 0x000001a8d2427310>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001a8d2427310>
> .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: 0x000001a8d2427310>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001a8d2427310>
> .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: 0x000001a8d2427310>
> 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: 0x000001a8d2426b30>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001a8d2426b30>
> .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: 0x000001a8d2426b30>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x000001a8d2426b30>
> .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: 0x000001a8d2426b30>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x000001a8d2426b30>
> .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: 0x000001a8d2426b30>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x000001a8d2426b30>
> .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: 0x000001a8d2426b30>
> 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: 0x000001a8d2426c80>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x000001a8d2426c80>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001a8d2426c80>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001a8d2426c80>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile45f83da270d0" "BufferedMatrixFile45f8558d3105"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile45f83da270d0" "BufferedMatrixFile45f8558d3105"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001a8d2426e40>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001a8d2426e40>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x000001a8d2426e40>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x000001a8d2426e40>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x000001a8d2426e40>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x000001a8d2426e40>
> .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: 0x000001a8d2427070>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001a8d2427070>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x000001a8d2427070>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x000001a8d2427070>
> 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: 0x000001a8d24275b0>
> .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: 0x000001a8d24275b0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
   0.29    0.17    0.67 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2022-12-25 r83502 ucrt) -- "Unsuffered Consequences"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

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.23    0.01    0.25 

Example timings