| Back to Multiple platform build/check report for BioC 3.9 |
|
This page was generated on 2019-10-16 12:46:20 -0400 (Wed, 16 Oct 2019).
| Package 193/1741 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||
| BufferedMatrix 1.48.0 Ben Bolstad
| malbec2 | Linux (Ubuntu 18.04.2 LTS) / x86_64 | OK | OK | OK | |||||||
| tokay2 | Windows Server 2012 R2 Standard / x64 | OK | OK | OK | OK | |||||||
| celaya2 | OS X 10.11.6 El Capitan / x86_64 | OK | OK | [ OK ] | OK |
| Package: BufferedMatrix |
| Version: 1.48.0 |
| Command: /Library/Frameworks/R.framework/Versions/Current/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Versions/Current/Resources/library --no-vignettes --timings BufferedMatrix_1.48.0.tar.gz |
| StartedAt: 2019-10-16 01:03:52 -0400 (Wed, 16 Oct 2019) |
| EndedAt: 2019-10-16 01:04:55 -0400 (Wed, 16 Oct 2019) |
| EllapsedTime: 63.0 seconds |
| RetCode: 0 |
| Status: OK |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 0 |
############################################################################## ############################################################################## ### ### Running command: ### ### /Library/Frameworks/R.framework/Versions/Current/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Versions/Current/Resources/library --no-vignettes --timings BufferedMatrix_1.48.0.tar.gz ### ############################################################################## ############################################################################## * using log directory ‘/Users/biocbuild/bbs-3.9-bioc/meat/BufferedMatrix.Rcheck’ * using R version 3.6.1 (2019-07-05) * using platform: x86_64-apple-darwin15.6.0 (64-bit) * using session charset: UTF-8 * using option ‘--no-vignettes’ * checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK * this is package ‘BufferedMatrix’ version ‘1.48.0’ * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking whether package ‘BufferedMatrix’ can be installed ... OK * 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 is not available * 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 ‘/Users/biocbuild/bbs-3.9-bioc/meat/BufferedMatrix.Rcheck/00check.log’ for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /Library/Frameworks/R.framework/Versions/Current/Resources/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** using staged installation
** libs
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
if (!(Matrix->readonly) & setting){
^ ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
if (!(Matrix->readonly) & setting){
^
( )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
if (!(Matrix->readonly) & setting){
^
( )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
static int sort_double(const double *a1,const double *a2){
^
2 warnings generated.
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c init_package.c -o init_package.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/3.6/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)
BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout
R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin15.6.0 (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.604 0.229 0.789
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin15.6.0 (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] "/Users/biocbuild/bbs-3.9-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
>
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 416332 22.3 881334 47.1 NA 616371 33.0
Vcells 749136 5.8 8388608 64.0 57344 1811917 13.9
>
>
>
>
> ##
> ## checking reads
> ##
>
> tmp2 <- createBufferedMatrix(10,20)
>
> test.sample <- rnorm(10*20)
>
> tmp2[1:10,1:20] <- test.sample
>
> test.matrix <- matrix(test.sample,10,20)
>
> ## testing reads
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Wed Oct 16 01:04:24 2019"
> 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 Oct 16 01:04:24 2019"
>
>
> 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)
>
>
>
> 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 Oct 16 01:04:29 2019"
> 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 Oct 16 01:04:31 2019"
>
> ColMode(tmp2)
>
>
>
> ### 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,] 97.58438555 0.7060983 -0.4304349 1.1922204
[2,] 1.65328409 0.5830453 0.3514291 -0.3275377
[3,] -0.23358006 -0.1101120 -0.7905913 0.5192477
[4,] 0.09454867 0.6620942 -1.2578278 0.3146465
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.9-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 97.58438555 0.7060983 0.4304349 1.1922204
[2,] 1.65328409 0.5830453 0.3514291 0.3275377
[3,] 0.23358006 0.1101120 0.7905913 0.5192477
[4,] 0.09454867 0.6620942 1.2578278 0.3146465
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.9-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 9.8784809 0.8402965 0.6560754 1.0918884
[2,] 1.2858010 0.7635740 0.5928145 0.5723091
[3,] 0.4833012 0.3318312 0.8891520 0.7205884
[4,] 0.3074877 0.8136917 1.1215292 0.5609336
>
> 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: /Users/biocbuild/bbs-3.9-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 221.36919 34.10906 31.99119 37.11110
[2,] 39.51129 33.21879 31.27957 31.05063
[3,] 30.06659 28.42842 34.68211 32.72513
[4,] 28.16943 33.79901 37.47312 30.92398
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
> exp(tmp5)
> log(tmp5,2)
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 460.751
> Min(tmp5)
[1] 53.02971
> mean(tmp5)
[1] 72.06316
> Sum(tmp5)
[1] 14412.63
> Var(tmp5)
[1] 828.7973
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 88.19970 73.66236 69.60319 67.02781 70.74955 68.68412 67.66977 73.64277
[9] 71.23776 70.15459
> rowSums(tmp5)
[1] 1763.994 1473.247 1392.064 1340.556 1414.991 1373.682 1353.395 1472.855
[9] 1424.755 1403.092
> rowVars(tmp5)
[1] 7720.34424 78.52026 66.83218 58.22241 25.78973 83.38588
[7] 53.95811 106.50586 73.52674 62.30098
> rowSd(tmp5)
[1] 87.865489 8.861166 8.175095 7.630361 5.078359 9.131587 7.345618
[8] 10.320167 8.574773 7.893097
> rowMax(tmp5)
[1] 460.75098 85.95927 87.88358 82.64771 83.90482 86.68074 81.32848
[8] 87.00686 91.18565 83.68225
> rowMin(tmp5)
[1] 56.99647 57.43742 55.16602 53.02971 63.08097 56.03800 56.45701 55.26542
[9] 60.14978 55.60946
>
> colMeans(tmp5)
[1] 107.25622 70.33854 70.59212 70.41924 72.11284 68.56060 71.20003
[8] 68.40044 73.99520 69.30122 68.66329 72.34652 67.14814 72.82678
[15] 67.16076 69.75009 71.25604 74.84454 64.59535 70.49529
> colSums(tmp5)
[1] 1072.5622 703.3854 705.9212 704.1924 721.1284 685.6060 712.0003
[8] 684.0044 739.9520 693.0122 686.6329 723.4652 671.4814 728.2678
[15] 671.6076 697.5009 712.5604 748.4454 645.9535 704.9529
> colVars(tmp5)
[1] 15511.03827 60.40379 40.65348 56.43445 63.53824 46.82634
[7] 89.31064 79.73528 25.93955 88.35132 115.06314 34.69963
[13] 81.12208 60.30405 137.83247 31.48451 64.13235 33.91721
[19] 49.52364 81.36109
> colSd(tmp5)
[1] 124.543319 7.771987 6.376008 7.512287 7.971088 6.842978
[7] 9.450431 8.929461 5.093089 9.399538 10.726749 5.890639
[13] 9.006779 7.765568 11.740207 5.611106 8.008268 5.823849
[19] 7.037303 9.020038
> colMax(tmp5)
[1] 460.75098 81.25209 82.63574 83.90482 84.21599 76.99782 87.88358
[8] 87.57951 82.64771 87.00686 84.11784 80.88465 80.37819 83.68225
[15] 91.18565 77.58905 86.68074 84.54986 76.85679 86.97863
> colMin(tmp5)
[1] 56.03800 56.63045 60.66768 61.42526 58.86624 57.43742 59.39123 57.37215
[9] 67.42860 58.89199 55.26542 62.78441 55.60946 60.30781 53.02971 59.01087
[17] 61.39771 66.24982 55.16602 60.14978
>
>
> ### 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] 88.19970 73.66236 69.60319 67.02781 70.74955 68.68412 67.66977 73.64277
[9] NA 70.15459
> rowSums(tmp5)
[1] 1763.994 1473.247 1392.064 1340.556 1414.991 1373.682 1353.395 1472.855
[9] NA 1403.092
> rowVars(tmp5)
[1] 7720.34424 78.52026 66.83218 58.22241 25.78973 83.38588
[7] 53.95811 106.50586 54.34149 62.30098
> rowSd(tmp5)
[1] 87.865489 8.861166 8.175095 7.630361 5.078359 9.131587 7.345618
[8] 10.320167 7.371668 7.893097
> rowMax(tmp5)
[1] 460.75098 85.95927 87.88358 82.64771 83.90482 86.68074 81.32848
[8] 87.00686 NA 83.68225
> rowMin(tmp5)
[1] 56.99647 57.43742 55.16602 53.02971 63.08097 56.03800 56.45701 55.26542
[9] NA 55.60946
>
> colMeans(tmp5)
[1] 107.25622 70.33854 70.59212 70.41924 72.11284 68.56060 71.20003
[8] 68.40044 73.99520 69.30122 68.66329 72.34652 67.14814 72.82678
[15] NA 69.75009 71.25604 74.84454 64.59535 70.49529
> colSums(tmp5)
[1] 1072.5622 703.3854 705.9212 704.1924 721.1284 685.6060 712.0003
[8] 684.0044 739.9520 693.0122 686.6329 723.4652 671.4814 728.2678
[15] NA 697.5009 712.5604 748.4454 645.9535 704.9529
> colVars(tmp5)
[1] 15511.03827 60.40379 40.65348 56.43445 63.53824 46.82634
[7] 89.31064 79.73528 25.93955 88.35132 115.06314 34.69963
[13] 81.12208 60.30405 NA 31.48451 64.13235 33.91721
[19] 49.52364 81.36109
> colSd(tmp5)
[1] 124.543319 7.771987 6.376008 7.512287 7.971088 6.842978
[7] 9.450431 8.929461 5.093089 9.399538 10.726749 5.890639
[13] 9.006779 7.765568 NA 5.611106 8.008268 5.823849
[19] 7.037303 9.020038
> colMax(tmp5)
[1] 460.75098 81.25209 82.63574 83.90482 84.21599 76.99782 87.88358
[8] 87.57951 82.64771 87.00686 84.11784 80.88465 80.37819 83.68225
[15] NA 77.58905 86.68074 84.54986 76.85679 86.97863
> colMin(tmp5)
[1] 56.03800 56.63045 60.66768 61.42526 58.86624 57.43742 59.39123 57.37215
[9] 67.42860 58.89199 55.26542 62.78441 55.60946 60.30781 NA 59.01087
[17] 61.39771 66.24982 55.16602 60.14978
>
> Max(tmp5,na.rm=TRUE)
[1] 460.751
> Min(tmp5,na.rm=TRUE)
[1] 53.02971
> mean(tmp5,na.rm=TRUE)
[1] 71.96707
> Sum(tmp5,na.rm=TRUE)
[1] 14321.45
> Var(tmp5,na.rm=TRUE)
[1] 831.127
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 88.19970 73.66236 69.60319 67.02781 70.74955 68.68412 67.66977 73.64277
[9] 70.18787 70.15459
> rowSums(tmp5,na.rm=TRUE)
[1] 1763.994 1473.247 1392.064 1340.556 1414.991 1373.682 1353.395 1472.855
[9] 1333.570 1403.092
> rowVars(tmp5,na.rm=TRUE)
[1] 7720.34424 78.52026 66.83218 58.22241 25.78973 83.38588
[7] 53.95811 106.50586 54.34149 62.30098
> rowSd(tmp5,na.rm=TRUE)
[1] 87.865489 8.861166 8.175095 7.630361 5.078359 9.131587 7.345618
[8] 10.320167 7.371668 7.893097
> rowMax(tmp5,na.rm=TRUE)
[1] 460.75098 85.95927 87.88358 82.64771 83.90482 86.68074 81.32848
[8] 87.00686 87.57951 83.68225
> rowMin(tmp5,na.rm=TRUE)
[1] 56.99647 57.43742 55.16602 53.02971 63.08097 56.03800 56.45701 55.26542
[9] 60.14978 55.60946
>
> colMeans(tmp5,na.rm=TRUE)
[1] 107.25622 70.33854 70.59212 70.41924 72.11284 68.56060 71.20003
[8] 68.40044 73.99520 69.30122 68.66329 72.34652 67.14814 72.82678
[15] 64.49133 69.75009 71.25604 74.84454 64.59535 70.49529
> colSums(tmp5,na.rm=TRUE)
[1] 1072.5622 703.3854 705.9212 704.1924 721.1284 685.6060 712.0003
[8] 684.0044 739.9520 693.0122 686.6329 723.4652 671.4814 728.2678
[15] 580.4220 697.5009 712.5604 748.4454 645.9535 704.9529
> colVars(tmp5,na.rm=TRUE)
[1] 15511.03827 60.40379 40.65348 56.43445 63.53824 46.82634
[7] 89.31064 79.73528 25.93955 88.35132 115.06314 34.69963
[13] 81.12208 60.30405 74.89552 31.48451 64.13235 33.91721
[19] 49.52364 81.36109
> colSd(tmp5,na.rm=TRUE)
[1] 124.543319 7.771987 6.376008 7.512287 7.971088 6.842978
[7] 9.450431 8.929461 5.093089 9.399538 10.726749 5.890639
[13] 9.006779 7.765568 8.654220 5.611106 8.008268 5.823849
[19] 7.037303 9.020038
> colMax(tmp5,na.rm=TRUE)
[1] 460.75098 81.25209 82.63574 83.90482 84.21599 76.99782 87.88358
[8] 87.57951 82.64771 87.00686 84.11784 80.88465 80.37819 83.68225
[15] 81.26294 77.58905 86.68074 84.54986 76.85679 86.97863
> colMin(tmp5,na.rm=TRUE)
[1] 56.03800 56.63045 60.66768 61.42526 58.86624 57.43742 59.39123 57.37215
[9] 67.42860 58.89199 55.26542 62.78441 55.60946 60.30781 53.02971 59.01087
[17] 61.39771 66.24982 55.16602 60.14978
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 88.19970 73.66236 69.60319 67.02781 70.74955 68.68412 67.66977 73.64277
[9] NaN 70.15459
> rowSums(tmp5,na.rm=TRUE)
[1] 1763.994 1473.247 1392.064 1340.556 1414.991 1373.682 1353.395 1472.855
[9] 0.000 1403.092
> rowVars(tmp5,na.rm=TRUE)
[1] 7720.34424 78.52026 66.83218 58.22241 25.78973 83.38588
[7] 53.95811 106.50586 NA 62.30098
> rowSd(tmp5,na.rm=TRUE)
[1] 87.865489 8.861166 8.175095 7.630361 5.078359 9.131587 7.345618
[8] 10.320167 NA 7.893097
> rowMax(tmp5,na.rm=TRUE)
[1] 460.75098 85.95927 87.88358 82.64771 83.90482 86.68074 81.32848
[8] 87.00686 NA 83.68225
> rowMin(tmp5,na.rm=TRUE)
[1] 56.99647 57.43742 55.16602 53.02971 63.08097 56.03800 56.45701 55.26542
[9] NA 55.60946
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 111.00500 70.37452 70.59493 71.41857 71.87334 68.40376 70.70968
[8] 66.26943 73.72250 69.64420 69.51520 72.09559 66.01002 72.38069
[15] NaN 69.74968 72.35141 75.79951 65.04331 71.64480
> colSums(tmp5,na.rm=TRUE)
[1] 999.0450 633.3707 635.3543 642.7672 646.8601 615.6338 636.3871 596.4248
[9] 663.5025 626.7978 625.6368 648.8604 594.0902 651.4262 0.0000 627.7471
[17] 651.1627 682.1956 585.3898 644.8032
> colVars(tmp5,na.rm=TRUE)
[1] 17291.81736 67.93970 45.73507 52.25381 70.83523 52.40290
[7] 97.76941 38.61371 28.34539 98.07181 121.28144 38.32872
[13] 76.69012 65.60343 NA 35.42007 58.65076 27.89726
[19] 53.45652 76.66600
> colSd(tmp5,na.rm=TRUE)
[1] 131.498355 8.242554 6.762771 7.228680 8.416367 7.238985
[7] 9.887842 6.213993 5.324039 9.903121 11.012785 6.191019
[13] 8.757289 8.099594 NA 5.951476 7.658378 5.281786
[19] 7.311397 8.755912
> colMax(tmp5,na.rm=TRUE)
[1] 460.75098 81.25209 82.63574 83.90482 84.21599 76.99782 87.88358
[8] 76.98829 82.64771 87.00686 84.11784 80.88465 80.37819 83.68225
[15] -Inf 77.58905 86.68074 84.54986 76.85679 86.97863
> colMin(tmp5,na.rm=TRUE)
[1] 56.03800 56.63045 60.66768 64.36422 58.86624 57.43742 59.39123 57.37215
[9] 67.42860 58.89199 55.26542 62.78441 55.60946 60.30781 Inf 59.01087
[17] 61.54441 67.18769 55.16602 62.16580
>
>
>
>
> 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] 253.0296 167.5860 121.8096 179.7710 107.9572 206.4286 274.7785 210.8892
[9] 214.5987 229.7318
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 253.0296 167.5860 121.8096 179.7710 107.9572 206.4286 274.7785 210.8892
[9] 214.5987 229.7318
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col <- 3
> cat(which.row," ",which.col,"\n")
1 3
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
[1] -2.842171e-14 -5.684342e-14 2.557954e-13 1.136868e-13 1.136868e-13
[6] -1.136868e-13 2.842171e-14 1.136868e-13 -1.705303e-13 0.000000e+00
[11] -1.847411e-13 -1.989520e-13 -1.136868e-13 -2.842171e-14 0.000000e+00
[16] -1.136868e-13 -2.842171e-14 -5.684342e-14 -2.842171e-14 2.273737e-13
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
5 14
10 8
3 7
1 18
5 9
8 4
3 5
9 8
10 7
6 20
1 14
8 1
7 20
6 12
5 11
8 6
8 17
3 20
6 15
9 5
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.983457
> Min(tmp)
[1] -2.442611
> mean(tmp)
[1] 0.02184371
> Sum(tmp)
[1] 2.184371
> Var(tmp)
[1] 1.030646
>
> rowMeans(tmp)
[1] 0.02184371
> rowSums(tmp)
[1] 2.184371
> rowVars(tmp)
[1] 1.030646
> rowSd(tmp)
[1] 1.015207
> rowMax(tmp)
[1] 2.983457
> rowMin(tmp)
[1] -2.442611
>
> colMeans(tmp)
[1] 0.924067577 -0.898059772 -1.161617546 2.983457275 -0.998169937
[6] 1.209915937 -0.510151494 0.242397247 -0.221240650 -1.694144733
[11] -1.880479084 0.684532654 -0.325377047 1.117973386 0.461567435
[16] -0.155721981 -0.639387164 -0.308737673 0.825734066 -0.661084178
[21] 0.299274906 1.213766321 -0.434339888 1.514091941 -0.046507154
[26] -1.834143149 0.699569543 -0.132524381 0.248691833 0.580585833
[31] 1.320649455 -2.091056895 0.688110343 -0.890058740 0.853697548
[36] 0.712293186 0.912490098 -1.734774216 -0.305650083 0.860413055
[41] 0.099189394 1.537696514 2.052336136 -0.555989381 -2.442610581
[46] 1.012685150 -0.037778479 1.086252972 1.015968110 0.550560566
[51] 0.492954309 0.347530721 -0.746334621 -0.511882690 0.111410830
[56] 1.348398245 -0.886763301 -0.494274044 1.707324322 0.322459518
[61] -1.383622383 -1.034854784 1.459263446 0.660163549 -0.580113377
[66] -0.839935597 0.105788238 0.008615506 -0.571836244 1.452208553
[71] -2.424690540 -0.591308052 1.003805635 -0.453925315 -1.471588357
[76] -0.140925350 -0.708934460 -0.165689181 0.381866562 0.232572230
[81] 0.982029167 -1.121321632 -0.666226287 -0.761388100 -0.713391089
[86] 0.820685534 -0.053576896 -0.219700225 -0.466902938 -0.049610976
[91] -1.006829782 0.501797590 1.921372246 -0.527295256 0.084036846
[96] 0.728618588 0.817079315 -0.973128344 -0.272359575 0.784434857
> colSums(tmp)
[1] 0.924067577 -0.898059772 -1.161617546 2.983457275 -0.998169937
[6] 1.209915937 -0.510151494 0.242397247 -0.221240650 -1.694144733
[11] -1.880479084 0.684532654 -0.325377047 1.117973386 0.461567435
[16] -0.155721981 -0.639387164 -0.308737673 0.825734066 -0.661084178
[21] 0.299274906 1.213766321 -0.434339888 1.514091941 -0.046507154
[26] -1.834143149 0.699569543 -0.132524381 0.248691833 0.580585833
[31] 1.320649455 -2.091056895 0.688110343 -0.890058740 0.853697548
[36] 0.712293186 0.912490098 -1.734774216 -0.305650083 0.860413055
[41] 0.099189394 1.537696514 2.052336136 -0.555989381 -2.442610581
[46] 1.012685150 -0.037778479 1.086252972 1.015968110 0.550560566
[51] 0.492954309 0.347530721 -0.746334621 -0.511882690 0.111410830
[56] 1.348398245 -0.886763301 -0.494274044 1.707324322 0.322459518
[61] -1.383622383 -1.034854784 1.459263446 0.660163549 -0.580113377
[66] -0.839935597 0.105788238 0.008615506 -0.571836244 1.452208553
[71] -2.424690540 -0.591308052 1.003805635 -0.453925315 -1.471588357
[76] -0.140925350 -0.708934460 -0.165689181 0.381866562 0.232572230
[81] 0.982029167 -1.121321632 -0.666226287 -0.761388100 -0.713391089
[86] 0.820685534 -0.053576896 -0.219700225 -0.466902938 -0.049610976
[91] -1.006829782 0.501797590 1.921372246 -0.527295256 0.084036846
[96] 0.728618588 0.817079315 -0.973128344 -0.272359575 0.784434857
> 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.924067577 -0.898059772 -1.161617546 2.983457275 -0.998169937
[6] 1.209915937 -0.510151494 0.242397247 -0.221240650 -1.694144733
[11] -1.880479084 0.684532654 -0.325377047 1.117973386 0.461567435
[16] -0.155721981 -0.639387164 -0.308737673 0.825734066 -0.661084178
[21] 0.299274906 1.213766321 -0.434339888 1.514091941 -0.046507154
[26] -1.834143149 0.699569543 -0.132524381 0.248691833 0.580585833
[31] 1.320649455 -2.091056895 0.688110343 -0.890058740 0.853697548
[36] 0.712293186 0.912490098 -1.734774216 -0.305650083 0.860413055
[41] 0.099189394 1.537696514 2.052336136 -0.555989381 -2.442610581
[46] 1.012685150 -0.037778479 1.086252972 1.015968110 0.550560566
[51] 0.492954309 0.347530721 -0.746334621 -0.511882690 0.111410830
[56] 1.348398245 -0.886763301 -0.494274044 1.707324322 0.322459518
[61] -1.383622383 -1.034854784 1.459263446 0.660163549 -0.580113377
[66] -0.839935597 0.105788238 0.008615506 -0.571836244 1.452208553
[71] -2.424690540 -0.591308052 1.003805635 -0.453925315 -1.471588357
[76] -0.140925350 -0.708934460 -0.165689181 0.381866562 0.232572230
[81] 0.982029167 -1.121321632 -0.666226287 -0.761388100 -0.713391089
[86] 0.820685534 -0.053576896 -0.219700225 -0.466902938 -0.049610976
[91] -1.006829782 0.501797590 1.921372246 -0.527295256 0.084036846
[96] 0.728618588 0.817079315 -0.973128344 -0.272359575 0.784434857
> colMin(tmp)
[1] 0.924067577 -0.898059772 -1.161617546 2.983457275 -0.998169937
[6] 1.209915937 -0.510151494 0.242397247 -0.221240650 -1.694144733
[11] -1.880479084 0.684532654 -0.325377047 1.117973386 0.461567435
[16] -0.155721981 -0.639387164 -0.308737673 0.825734066 -0.661084178
[21] 0.299274906 1.213766321 -0.434339888 1.514091941 -0.046507154
[26] -1.834143149 0.699569543 -0.132524381 0.248691833 0.580585833
[31] 1.320649455 -2.091056895 0.688110343 -0.890058740 0.853697548
[36] 0.712293186 0.912490098 -1.734774216 -0.305650083 0.860413055
[41] 0.099189394 1.537696514 2.052336136 -0.555989381 -2.442610581
[46] 1.012685150 -0.037778479 1.086252972 1.015968110 0.550560566
[51] 0.492954309 0.347530721 -0.746334621 -0.511882690 0.111410830
[56] 1.348398245 -0.886763301 -0.494274044 1.707324322 0.322459518
[61] -1.383622383 -1.034854784 1.459263446 0.660163549 -0.580113377
[66] -0.839935597 0.105788238 0.008615506 -0.571836244 1.452208553
[71] -2.424690540 -0.591308052 1.003805635 -0.453925315 -1.471588357
[76] -0.140925350 -0.708934460 -0.165689181 0.381866562 0.232572230
[81] 0.982029167 -1.121321632 -0.666226287 -0.761388100 -0.713391089
[86] 0.820685534 -0.053576896 -0.219700225 -0.466902938 -0.049610976
[91] -1.006829782 0.501797590 1.921372246 -0.527295256 0.084036846
[96] 0.728618588 0.817079315 -0.973128344 -0.272359575 0.784434857
> colMedians(tmp)
[1] 0.924067577 -0.898059772 -1.161617546 2.983457275 -0.998169937
[6] 1.209915937 -0.510151494 0.242397247 -0.221240650 -1.694144733
[11] -1.880479084 0.684532654 -0.325377047 1.117973386 0.461567435
[16] -0.155721981 -0.639387164 -0.308737673 0.825734066 -0.661084178
[21] 0.299274906 1.213766321 -0.434339888 1.514091941 -0.046507154
[26] -1.834143149 0.699569543 -0.132524381 0.248691833 0.580585833
[31] 1.320649455 -2.091056895 0.688110343 -0.890058740 0.853697548
[36] 0.712293186 0.912490098 -1.734774216 -0.305650083 0.860413055
[41] 0.099189394 1.537696514 2.052336136 -0.555989381 -2.442610581
[46] 1.012685150 -0.037778479 1.086252972 1.015968110 0.550560566
[51] 0.492954309 0.347530721 -0.746334621 -0.511882690 0.111410830
[56] 1.348398245 -0.886763301 -0.494274044 1.707324322 0.322459518
[61] -1.383622383 -1.034854784 1.459263446 0.660163549 -0.580113377
[66] -0.839935597 0.105788238 0.008615506 -0.571836244 1.452208553
[71] -2.424690540 -0.591308052 1.003805635 -0.453925315 -1.471588357
[76] -0.140925350 -0.708934460 -0.165689181 0.381866562 0.232572230
[81] 0.982029167 -1.121321632 -0.666226287 -0.761388100 -0.713391089
[86] 0.820685534 -0.053576896 -0.219700225 -0.466902938 -0.049610976
[91] -1.006829782 0.501797590 1.921372246 -0.527295256 0.084036846
[96] 0.728618588 0.817079315 -0.973128344 -0.272359575 0.784434857
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.9240676 -0.8980598 -1.161618 2.983457 -0.9981699 1.209916 -0.5101515
[2,] 0.9240676 -0.8980598 -1.161618 2.983457 -0.9981699 1.209916 -0.5101515
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.2423972 -0.2212406 -1.694145 -1.880479 0.6845327 -0.325377 1.117973
[2,] 0.2423972 -0.2212406 -1.694145 -1.880479 0.6845327 -0.325377 1.117973
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 0.4615674 -0.155722 -0.6393872 -0.3087377 0.8257341 -0.6610842 0.2992749
[2,] 0.4615674 -0.155722 -0.6393872 -0.3087377 0.8257341 -0.6610842 0.2992749
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 1.213766 -0.4343399 1.514092 -0.04650715 -1.834143 0.6995695 -0.1325244
[2,] 1.213766 -0.4343399 1.514092 -0.04650715 -1.834143 0.6995695 -0.1325244
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.2486918 0.5805858 1.320649 -2.091057 0.6881103 -0.8900587 0.8536975
[2,] 0.2486918 0.5805858 1.320649 -2.091057 0.6881103 -0.8900587 0.8536975
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 0.7122932 0.9124901 -1.734774 -0.3056501 0.8604131 0.09918939 1.537697
[2,] 0.7122932 0.9124901 -1.734774 -0.3056501 0.8604131 0.09918939 1.537697
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 2.052336 -0.5559894 -2.442611 1.012685 -0.03777848 1.086253 1.015968
[2,] 2.052336 -0.5559894 -2.442611 1.012685 -0.03777848 1.086253 1.015968
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 0.5505606 0.4929543 0.3475307 -0.7463346 -0.5118827 0.1114108 1.348398
[2,] 0.5505606 0.4929543 0.3475307 -0.7463346 -0.5118827 0.1114108 1.348398
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] -0.8867633 -0.494274 1.707324 0.3224595 -1.383622 -1.034855 1.459263
[2,] -0.8867633 -0.494274 1.707324 0.3224595 -1.383622 -1.034855 1.459263
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 0.6601635 -0.5801134 -0.8399356 0.1057882 0.008615506 -0.5718362 1.452209
[2,] 0.6601635 -0.5801134 -0.8399356 0.1057882 0.008615506 -0.5718362 1.452209
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -2.424691 -0.5913081 1.003806 -0.4539253 -1.471588 -0.1409254 -0.7089345
[2,] -2.424691 -0.5913081 1.003806 -0.4539253 -1.471588 -0.1409254 -0.7089345
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -0.1656892 0.3818666 0.2325722 0.9820292 -1.121322 -0.6662263 -0.7613881
[2,] -0.1656892 0.3818666 0.2325722 0.9820292 -1.121322 -0.6662263 -0.7613881
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -0.7133911 0.8206855 -0.0535769 -0.2197002 -0.4669029 -0.04961098 -1.00683
[2,] -0.7133911 0.8206855 -0.0535769 -0.2197002 -0.4669029 -0.04961098 -1.00683
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 0.5017976 1.921372 -0.5272953 0.08403685 0.7286186 0.8170793 -0.9731283
[2,] 0.5017976 1.921372 -0.5272953 0.08403685 0.7286186 0.8170793 -0.9731283
[,99] [,100]
[1,] -0.2723596 0.7844349
[2,] -0.2723596 0.7844349
>
>
> Max(tmp2)
[1] 2.408883
> Min(tmp2)
[1] -2.083197
> mean(tmp2)
[1] 0.07182362
> Sum(tmp2)
[1] 7.182362
> Var(tmp2)
[1] 0.848972
>
> rowMeans(tmp2)
[1] 0.80684368 -0.34432449 0.71222104 0.79405067 1.00604176 -1.04508627
[7] -0.50408336 -0.97233480 0.75338194 -1.16087505 0.48810814 -0.06962583
[13] -1.20527133 -0.29980199 -0.24433970 -1.24586100 1.22886915 -0.62885743
[19] 0.37026266 0.22873073 2.01960424 1.09933433 1.79168427 0.36324281
[25] -0.42934001 1.47286329 -0.15651535 1.04748959 0.02027258 0.08747592
[31] -2.08319680 -0.05969580 1.55605055 0.38471630 -1.20533462 1.04517193
[37] -0.59361654 -0.71546786 -0.26309410 -0.39067627 -1.66318619 1.48821422
[43] 0.08205470 0.16885667 0.26272125 1.24035957 0.72324607 0.45677958
[49] 1.08460410 1.04619640 -0.11877723 0.65994718 0.58646841 0.43185307
[55] 0.79760639 -1.66811119 -1.63597449 -0.73874710 -0.32519511 0.85859730
[61] 0.19242397 -0.25871049 -0.47946717 -0.46384700 -0.26676584 0.28292988
[67] 0.50665149 0.26127712 -0.65253215 -0.24385778 -0.36764152 0.70869930
[73] -1.87718198 -1.46422637 -0.18886938 0.35428016 2.40888268 -0.34891870
[79] -0.22186912 0.53487099 -0.58359246 -1.01597045 0.14227550 -1.62083923
[85] 1.80345618 -0.14515247 -0.06359008 0.73658141 -0.47330426 0.06042918
[91] -0.29115015 -0.74274020 -0.71398353 0.55633248 -0.93219110 0.89161024
[97] 0.23219514 0.41914216 2.14993066 0.96026427
> rowSums(tmp2)
[1] 0.80684368 -0.34432449 0.71222104 0.79405067 1.00604176 -1.04508627
[7] -0.50408336 -0.97233480 0.75338194 -1.16087505 0.48810814 -0.06962583
[13] -1.20527133 -0.29980199 -0.24433970 -1.24586100 1.22886915 -0.62885743
[19] 0.37026266 0.22873073 2.01960424 1.09933433 1.79168427 0.36324281
[25] -0.42934001 1.47286329 -0.15651535 1.04748959 0.02027258 0.08747592
[31] -2.08319680 -0.05969580 1.55605055 0.38471630 -1.20533462 1.04517193
[37] -0.59361654 -0.71546786 -0.26309410 -0.39067627 -1.66318619 1.48821422
[43] 0.08205470 0.16885667 0.26272125 1.24035957 0.72324607 0.45677958
[49] 1.08460410 1.04619640 -0.11877723 0.65994718 0.58646841 0.43185307
[55] 0.79760639 -1.66811119 -1.63597449 -0.73874710 -0.32519511 0.85859730
[61] 0.19242397 -0.25871049 -0.47946717 -0.46384700 -0.26676584 0.28292988
[67] 0.50665149 0.26127712 -0.65253215 -0.24385778 -0.36764152 0.70869930
[73] -1.87718198 -1.46422637 -0.18886938 0.35428016 2.40888268 -0.34891870
[79] -0.22186912 0.53487099 -0.58359246 -1.01597045 0.14227550 -1.62083923
[85] 1.80345618 -0.14515247 -0.06359008 0.73658141 -0.47330426 0.06042918
[91] -0.29115015 -0.74274020 -0.71398353 0.55633248 -0.93219110 0.89161024
[97] 0.23219514 0.41914216 2.14993066 0.96026427
> 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.80684368 -0.34432449 0.71222104 0.79405067 1.00604176 -1.04508627
[7] -0.50408336 -0.97233480 0.75338194 -1.16087505 0.48810814 -0.06962583
[13] -1.20527133 -0.29980199 -0.24433970 -1.24586100 1.22886915 -0.62885743
[19] 0.37026266 0.22873073 2.01960424 1.09933433 1.79168427 0.36324281
[25] -0.42934001 1.47286329 -0.15651535 1.04748959 0.02027258 0.08747592
[31] -2.08319680 -0.05969580 1.55605055 0.38471630 -1.20533462 1.04517193
[37] -0.59361654 -0.71546786 -0.26309410 -0.39067627 -1.66318619 1.48821422
[43] 0.08205470 0.16885667 0.26272125 1.24035957 0.72324607 0.45677958
[49] 1.08460410 1.04619640 -0.11877723 0.65994718 0.58646841 0.43185307
[55] 0.79760639 -1.66811119 -1.63597449 -0.73874710 -0.32519511 0.85859730
[61] 0.19242397 -0.25871049 -0.47946717 -0.46384700 -0.26676584 0.28292988
[67] 0.50665149 0.26127712 -0.65253215 -0.24385778 -0.36764152 0.70869930
[73] -1.87718198 -1.46422637 -0.18886938 0.35428016 2.40888268 -0.34891870
[79] -0.22186912 0.53487099 -0.58359246 -1.01597045 0.14227550 -1.62083923
[85] 1.80345618 -0.14515247 -0.06359008 0.73658141 -0.47330426 0.06042918
[91] -0.29115015 -0.74274020 -0.71398353 0.55633248 -0.93219110 0.89161024
[97] 0.23219514 0.41914216 2.14993066 0.96026427
> rowMin(tmp2)
[1] 0.80684368 -0.34432449 0.71222104 0.79405067 1.00604176 -1.04508627
[7] -0.50408336 -0.97233480 0.75338194 -1.16087505 0.48810814 -0.06962583
[13] -1.20527133 -0.29980199 -0.24433970 -1.24586100 1.22886915 -0.62885743
[19] 0.37026266 0.22873073 2.01960424 1.09933433 1.79168427 0.36324281
[25] -0.42934001 1.47286329 -0.15651535 1.04748959 0.02027258 0.08747592
[31] -2.08319680 -0.05969580 1.55605055 0.38471630 -1.20533462 1.04517193
[37] -0.59361654 -0.71546786 -0.26309410 -0.39067627 -1.66318619 1.48821422
[43] 0.08205470 0.16885667 0.26272125 1.24035957 0.72324607 0.45677958
[49] 1.08460410 1.04619640 -0.11877723 0.65994718 0.58646841 0.43185307
[55] 0.79760639 -1.66811119 -1.63597449 -0.73874710 -0.32519511 0.85859730
[61] 0.19242397 -0.25871049 -0.47946717 -0.46384700 -0.26676584 0.28292988
[67] 0.50665149 0.26127712 -0.65253215 -0.24385778 -0.36764152 0.70869930
[73] -1.87718198 -1.46422637 -0.18886938 0.35428016 2.40888268 -0.34891870
[79] -0.22186912 0.53487099 -0.58359246 -1.01597045 0.14227550 -1.62083923
[85] 1.80345618 -0.14515247 -0.06359008 0.73658141 -0.47330426 0.06042918
[91] -0.29115015 -0.74274020 -0.71398353 0.55633248 -0.93219110 0.89161024
[97] 0.23219514 0.41914216 2.14993066 0.96026427
>
> colMeans(tmp2)
[1] 0.07182362
> colSums(tmp2)
[1] 7.182362
> colVars(tmp2)
[1] 0.848972
> colSd(tmp2)
[1] 0.9213968
> colMax(tmp2)
[1] 2.408883
> colMin(tmp2)
[1] -2.083197
> colMedians(tmp2)
[1] 0.07124194
> colRanges(tmp2)
[,1]
[1,] -2.083197
[2,] 2.408883
>
> dataset1 <- matrix(dataset1,1,100)
>
> agree.checks(tmp,dataset1)
>
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>
>
> tmp <- createBufferedMatrix(10,10)
>
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
[1] -3.7691948 -4.1353356 0.4115922 3.8269107 -0.5684328 -1.3015475
[7] 2.7095316 1.2826986 -2.9577210 -1.6434114
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.8303409
[2,] -1.2987701
[3,] -0.1054165
[4,] 0.1565344
[5,] 1.1674366
>
> rowApply(tmp,sum)
[1] 0.05128983 -2.38316483 0.66107169 0.57936459 -0.22630280 0.53394255
[7] 0.21793954 -2.99888673 -1.83987150 -0.74029228
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 10 7 1 1 5 6 4 1 10 4
[2,] 8 1 9 5 2 1 1 4 4 8
[3,] 5 5 4 3 6 10 8 6 2 9
[4,] 6 10 10 4 10 8 5 8 8 2
[5,] 4 2 5 8 3 4 10 9 5 5
[6,] 7 6 8 6 1 5 7 3 7 7
[7,] 3 9 3 7 9 3 2 5 6 10
[8,] 2 8 2 10 7 7 3 10 3 3
[9,] 1 4 6 9 4 9 6 7 1 1
[10,] 9 3 7 2 8 2 9 2 9 6
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -1.10519142 0.68383435 3.55286477 2.52141613 -3.41306786 1.43952682
[7] 1.32024385 1.60995578 -3.10257487 -1.83072118 -1.12461315 1.79676059
[13] -1.74938124 1.22033131 0.08665534 -1.51774784 -2.55250432 -2.21846951
[19] -0.93741338 1.65440430
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.6795390
[2,] -0.5060106
[3,] -0.4586773
[4,] -0.2440220
[5,] 0.7830574
>
> rowApply(tmp,sum)
[1] -3.5307903 1.9909901 5.2540700 -0.2689952 -7.1109661
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 5 7 7 18 8
[2,] 17 17 11 14 6
[3,] 20 18 5 2 20
[4,] 13 15 13 20 14
[5,] 9 12 6 5 1
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.5060106 0.1657204 1.3598931 -0.03344693 -0.3884716 -0.6869819
[2,] -0.4586773 0.8478433 1.3771456 0.66214746 0.3958082 -0.1998199
[3,] -0.2440220 0.2398877 -0.4589852 0.65338683 -0.4502287 2.2552746
[4,] 0.7830574 0.6609193 -1.2890514 1.08387464 -0.8477160 -0.0985341
[5,] -0.6795390 -1.2305365 2.5638627 0.15545413 -2.1224598 0.1695882
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.14047427 0.1205334 -0.004213659 -0.7685390 -0.07091053 1.35030304
[2,] 0.40044642 2.9562443 -0.790358685 -1.0309678 -0.24337289 -1.22305909
[3,] 1.63035760 0.7222024 -0.803420118 -1.2364568 0.93706482 -0.05814075
[4,] -0.09656583 -0.6169758 -1.683513384 1.0281014 -0.08544470 0.68778848
[5,] -0.47352008 -1.5720485 0.178930982 0.1771411 -1.66194984 1.03986892
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -0.09787914 0.41152025 0.1515100 -0.4002191 -1.93651938 -1.25122040
[2,] -1.61182550 0.75536287 -1.0718415 1.5801001 -0.02839621 -1.10348039
[3,] -0.21312863 0.94821798 1.7713860 -0.9241305 -0.02106769 1.16921846
[4,] 0.38870515 -0.96520229 0.6717597 -0.3485975 0.41622098 -1.00717607
[5,] -0.21525313 0.07043251 -1.4361588 -1.4249008 -0.98274202 -0.02581112
[,19] [,20]
[1,] -0.4065593 -0.3988245
[2,] 0.2558836 0.5218075
[3,] -0.9749129 0.3115668
[4,] 0.6675333 0.3818214
[5,] -0.4793581 0.8380330
>
>
> is.BufferedMatrix(tmp)
[1] TRUE
>
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size: 5 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.9-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 800 bytes.
>
>
>
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size: 5 5
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.9-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 648 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.9-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 562 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.9-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 0.04203144 -0.9170936 0.1997773 1.140657 -0.4692051 0.9981432 -1.308415
col8 col9 col10 col11 col12 col13
row1 -0.7388672 -0.2818621 -0.0002036269 -0.3036031 -0.6511568 -1.696375
col14 col15 col16 col17 col18 col19 col20
row1 -0.323665 -0.8173553 -0.7736268 -1.275165 0.5677564 -0.50326 -0.7933364
> tmp[,"col10"]
col10
row1 -0.0002036269
row2 0.8004379044
row3 -1.1676215826
row4 -0.7314985171
row5 0.2056015567
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 0.04203144 -0.9170936 0.1997773 1.140657 -0.4692051 0.9981432
row5 -0.09400620 -1.0788388 -0.2821037 1.231499 -0.2164277 -0.9470449
col7 col8 col9 col10 col11 col12
row1 -1.3084149 -0.7388672 -0.2818621 -0.0002036269 -0.3036031 -0.6511568
row5 0.2733988 -1.8061149 -1.0494525 0.2056015567 0.3521840 0.8214299
col13 col14 col15 col16 col17 col18
row1 -1.69637493 -0.323665 -0.8173553 -0.7736268 -1.27516453 0.5677564
row5 -0.05384207 -0.350932 -0.6612560 -0.3414070 -0.02974262 0.1125755
col19 col20
row1 -0.5032600 -0.79333638
row5 0.1243288 -0.07436056
> tmp[,c("col6","col20")]
col6 col20
row1 0.99814316 -0.79333638
row2 0.95886794 1.79845419
row3 -0.02524775 -1.46880845
row4 -2.65322434 1.79220622
row5 -0.94704490 -0.07436056
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 0.9981432 -0.79333638
row5 -0.9470449 -0.07436056
>
>
>
>
> 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 51.72325 50.09978 50.03107 49.12985 48.87111 103.8485 50.13523 49.58261
col9 col10 col11 col12 col13 col14 col15 col16
row1 52.52764 50.08362 50.89422 50.31214 49.60589 48.83588 47.6156 49.97364
col17 col18 col19 col20
row1 48.86991 52.5281 49.21774 105.7155
> tmp[,"col10"]
col10
row1 50.08362
row2 31.20077
row3 28.23516
row4 31.70047
row5 50.01483
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 51.72325 50.09978 50.03107 49.12985 48.87111 103.8485 50.13523 49.58261
row5 48.74619 49.25336 49.29347 48.64736 51.50877 106.2376 49.47001 50.62412
col9 col10 col11 col12 col13 col14 col15 col16
row1 52.52764 50.08362 50.89422 50.31214 49.60589 48.83588 47.61560 49.97364
row5 50.34855 50.01483 51.36337 50.43076 48.91802 49.37790 48.11864 50.11239
col17 col18 col19 col20
row1 48.86991 52.5281 49.21774 105.7155
row5 48.86024 50.4304 49.61751 107.2035
> tmp[,c("col6","col20")]
col6 col20
row1 103.84849 105.71547
row2 74.40732 76.48779
row3 75.16699 76.38678
row4 75.18536 74.43195
row5 106.23762 107.20351
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 103.8485 105.7155
row5 106.2376 107.2035
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 103.8485 105.7155
row5 106.2376 107.2035
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.6525495
[2,] 0.4733654
[3,] 0.3534421
[4,] -0.5239461
[5,] -1.5259877
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.5050831 -0.48790165
[2,] -0.7010160 0.07288057
[3,] -0.5827507 1.11283927
[4,] -0.6688403 -0.27830651
[5,] -0.9815874 1.96530905
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -0.6073983 -0.02884651
[2,] -1.4418634 -0.63665934
[3,] 0.6818486 1.69932931
[4,] -0.1714158 -2.30450448
[5,] 1.0648610 -0.34064738
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -0.6073983
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -0.6073983
[2,] -1.4418634
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6]
row3 -0.01596288 0.05615648 -1.7839854 -0.2579460 0.1003228 0.3118718
row1 1.23231359 -0.13489913 -0.8930884 -0.8164535 -0.8402902 -1.3617252
[,7] [,8] [,9] [,10] [,11] [,12] [,13]
row3 2.0604972 0.2049213 -0.1347687 0.5528563 0.1377715 0.9664886 -1.049967
row1 -0.2483784 0.1445084 -0.2382423 -2.5710068 0.2259582 1.2589390 1.518846
[,14] [,15] [,16] [,17] [,18] [,19]
row3 0.9762574 -1.356036 -1.7332330 -0.2837910 -0.2766812 -0.3830491
row1 -1.1539378 -1.895346 0.3142619 0.2189774 0.8896784 -2.5168151
[,20]
row3 -0.07360957
row1 0.40525167
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 1.577226 1.057531 0.07665099 -0.08730894 -0.6264366 -0.8431375 -0.4827484
[,8] [,9] [,10]
row2 -0.6805508 -0.3546554 0.6004937
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -0.3271712 -0.3077747 0.173351 1.546228 0.08795268 0.5198615 -0.2539955
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 1.903218 -0.4598349 -1.887354 -2.742614 -0.5985208 -1.717239 -0.7910544
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.02375437 -1.152963 -1.875874 0.08204442 1.888367 0.1647071
>
>
> 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)
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.9-bioc/meat/BufferedMatrix.Rcheck/tests/BM10b852bdaa79a"
[2] "/Users/biocbuild/bbs-3.9-bioc/meat/BufferedMatrix.Rcheck/tests/BM10b85203185f4"
[3] "/Users/biocbuild/bbs-3.9-bioc/meat/BufferedMatrix.Rcheck/tests/BM10b85135166af"
[4] "/Users/biocbuild/bbs-3.9-bioc/meat/BufferedMatrix.Rcheck/tests/BM10b85452c7511"
[5] "/Users/biocbuild/bbs-3.9-bioc/meat/BufferedMatrix.Rcheck/tests/BM10b8569b9d291"
[6] "/Users/biocbuild/bbs-3.9-bioc/meat/BufferedMatrix.Rcheck/tests/BM10b8526af63d1"
[7] "/Users/biocbuild/bbs-3.9-bioc/meat/BufferedMatrix.Rcheck/tests/BM10b8544c2422e"
[8] "/Users/biocbuild/bbs-3.9-bioc/meat/BufferedMatrix.Rcheck/tests/BM10b852d86fd46"
[9] "/Users/biocbuild/bbs-3.9-bioc/meat/BufferedMatrix.Rcheck/tests/BM10b85795e1603"
[10] "/Users/biocbuild/bbs-3.9-bioc/meat/BufferedMatrix.Rcheck/tests/BM10b85ff75d35"
[11] "/Users/biocbuild/bbs-3.9-bioc/meat/BufferedMatrix.Rcheck/tests/BM10b8539084ac3"
[12] "/Users/biocbuild/bbs-3.9-bioc/meat/BufferedMatrix.Rcheck/tests/BM10b854f646575"
[13] "/Users/biocbuild/bbs-3.9-bioc/meat/BufferedMatrix.Rcheck/tests/BM10b8548410d0b"
[14] "/Users/biocbuild/bbs-3.9-bioc/meat/BufferedMatrix.Rcheck/tests/BM10b8526bf723c"
[15] "/Users/biocbuild/bbs-3.9-bioc/meat/BufferedMatrix.Rcheck/tests/BM10b8562e4d503"
>
>
> ### 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)
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.9-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
> rowMedians(tmp)
[1] -0.088637921 -0.081971635 -0.095040975 0.179864366 0.071805764
[6] 0.308820127 -0.259593456 -0.026616138 0.360184626 0.506268746
[11] -0.236499251 -0.656289195 0.430856459 0.164342407 -0.122317795
[16] -0.022720997 0.218067411 0.359829662 0.155675044 0.125974212
[21] 0.059603717 0.157929330 -0.403994776 -0.156647413 0.153369767
[26] 0.314409792 0.231121358 -0.066430724 0.247885942 -0.122796567
[31] 0.413364382 0.015143989 0.005883620 -0.241583490 0.126787257
[36] -0.177202079 -0.186058590 -0.348422529 0.018189137 -0.246384073
[41] 0.540623238 0.003275260 -0.152612356 -0.138957856 -0.262507866
[46] 0.237785248 0.386517572 0.371410101 0.673098989 -0.133423475
[51] -0.275365052 0.405245736 0.043550555 0.276408327 -0.184219521
[56] -0.384152494 0.148181585 0.028211747 -0.344525605 0.182718630
[61] -0.012628737 -0.073362272 0.136760561 0.241423777 -0.297554965
[66] -0.119465145 0.154459283 -0.064901441 0.186394111 -0.506711451
[71] 0.293528110 -0.227496835 0.212443186 0.276988935 0.080790372
[76] 0.082208972 0.131364986 0.534498481 -0.306167029 0.177700359
[81] -0.337363689 -0.619960304 0.049077512 0.208088065 -0.428487272
[86] -0.042822460 0.261211658 -0.221746387 0.817027599 0.458431705
[91] 0.332027570 -0.082759618 0.797833956 0.412830428 0.655665753
[96] 0.655980281 0.081700785 0.225867722 0.131381572 0.267171380
[101] 0.033545034 0.162426107 -0.541283210 0.268106271 0.588081761
[106] -0.101568697 0.495477898 0.365929945 0.374146699 0.490176921
[111] -0.332706530 0.011664433 0.105999950 -0.143048211 -0.243640496
[116] 0.015581848 0.118630328 0.167629213 -0.008872273 0.022172787
[121] 0.234369531 -0.059281416 0.345307954 -0.050961977 -0.397307896
[126] 0.385694670 0.425202739 -0.364518898 0.659389898 0.244171494
[131] -0.599552484 0.488283193 -0.343178709 0.026992858 -0.091484129
[136] -0.373838137 -0.659320784 -0.559965948 0.037829988 0.269804421
[141] -0.467952738 -0.382880796 0.288428651 0.291457398 -0.449794517
[146] 0.177917369 0.258628192 -0.224293283 0.344563597 0.156235582
[151] -0.029861133 0.120977354 -0.099610157 0.211243977 -0.539386852
[156] -0.569375504 0.062094879 0.058572603 0.299616511 -0.348573415
[161] -0.383760203 0.419940272 -0.484183902 0.072630605 -0.041218406
[166] 0.207401654 -0.155521163 -0.124421139 1.032899783 -0.216225298
[171] 0.317272927 -0.618791166 0.183878067 -0.096956113 0.278865811
[176] -0.266877424 0.193946650 -0.131546359 0.095875727 -0.287598665
[181] 0.496847225 0.215457897 0.043201351 -0.107466196 -0.189468035
[186] 0.111408138 0.091248136 0.081358118 -0.159089961 0.063462732
[191] 0.597866520 -0.348678838 -0.134120131 -0.358031727 -0.513138944
[196] -0.421532522 0.444604786 0.299857212 -0.138824203 0.006365489
[201] -0.380606508 -0.046414119 0.032435287 -0.120451992 0.070169618
[206] -0.507683579 -0.388672118 -0.060638857 0.617714882 -0.124560944
[211] -0.395168919 0.399263867 0.136011632 0.118356447 0.191384237
[216] -0.212006557 0.106139656 -0.039343362 0.211763829 -0.172271792
[221] 0.100447757 0.250396733 0.242889478 0.428467660 -0.129845209
[226] 0.732071095 -0.360271947 -0.191074538 0.441007404 0.002932163
>
> proc.time()
user system elapsed
6.422 15.570 23.841
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin15.6.0 (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
> .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
> .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
> .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
> 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
> .Call("R_bm_AddColumn",P)
> .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
> .Call("R_bm_AddColumn",P)
> .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
> rm(P)
>
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,5)
[1] TRUE
> .Call("R_bm_AddColumn",P)
> .Call("R_bm_AddColumn",P)
> .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
>
> .Call("R_bm_ResizeBuffer",P,5,5)
> .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
>
> .Call("R_bm_RowMode",P)
> .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
>
> .Call("R_bm_ColMode",P)
> .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
> rm(P)
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
> .Call("R_bm_AddColumn",P)
> .Call("R_bm_AddColumn",P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile10db8183b8911" "BufferedMatrixFile10db86ca3c784"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile10db8183b8911" "BufferedMatrixFile10db86ca3c784"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
> .Call("R_bm_AddColumn",P)
> .Call("R_bm_ReadOnlyModeToggle",P)
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
> .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)
> .Call("R_bm_AddColumn",P)
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
> 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
> .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
> rm(P)
>
> proc.time()
user system elapsed
0.635 0.250 0.835
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin15.6.0 (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.528 0.159 0.634