binarizeMatrix: Utility function to binarize a matrix of measurements

Description Usage Arguments Value See Also Examples

View source: R/binarizeMatrix.R

Description

Binarizes a matrix of measurements all at once, and returns the binarized vectors as well as the binarization thresholds and the p-values.

Usage

1
2
3
4
binarizeMatrix(mat, 
               method = c("BASCA", "BASCB", "kMeans"), 
               adjustment = "none", 
               ...)

Arguments

mat

A n x m matrix comprising m raw measurements of n features.

method

The binarization algorithm to be used. method="BASCA" calls binarize.BASC with method="A". method="BASCB" calls binarize.BASC with method="B". method="kMeans" calls binarize.kMeans.

adjustment

Specifies an optional adjustment for multiple testing that is applied to the p-values (see p.adjust for possible values). By default, no adjustment is applied.

...

Further parameters that are passed to the respective binarization methods (binarize.BASC or method="kMeans").

Value

A n x (m+2) matrix of binarized measurements. Here, the first m columns correspond to the binarized measurements. The m+1-st column comprises the binarization thresholds for the features, and the m+2-nd column contains the p-values.

See Also

binarize.BASC, binarize.kMeans, p.adjust

Examples

1
2
bin <- binarizeMatrix(t(iris[,1:4]))
print(bin)

Example output

Loading required package: diptest
             V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 V16 V17 V18 V19
Sepal.Length  0  0  0  0  0  0  0  0  0   0   0   0   0   0   0   0   0   0   0
Sepal.Width   1  0  1  1  1  1  1  1  0   1   1   1   0   0   1   1   1   1   1
Petal.Length  0  0  0  0  0  0  0  0  0   0   0   0   0   0   0   0   0   0   0
Petal.Width   0  0  0  0  0  0  0  0  0   0   0   0   0   0   0   0   0   0   0
             V20 V21 V22 V23 V24 V25 V26 V27 V28 V29 V30 V31 V32 V33 V34 V35
Sepal.Length   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
Sepal.Width    1   1   1   1   1   1   0   1   1   1   1   1   1   1   1   1
Petal.Length   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
Petal.Width    0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
             V36 V37 V38 V39 V40 V41 V42 V43 V44 V45 V46 V47 V48 V49 V50 V51
Sepal.Length   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   1
Sepal.Width    1   1   1   0   1   1   0   1   1   1   0   1   1   1   1   1
Petal.Length   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   1
Petal.Width    0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   1
             V52 V53 V54 V55 V56 V57 V58 V59 V60 V61 V62 V63 V64 V65 V66 V67
Sepal.Length   1   1   0   1   0   1   0   1   0   0   1   1   1   0   1   0
Sepal.Width    1   1   0   0   0   1   0   0   0   0   0   0   0   0   1   0
Petal.Length   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
Petal.Width    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
             V68 V69 V70 V71 V72 V73 V74 V75 V76 V77 V78 V79 V80 V81 V82 V83
Sepal.Length   0   1   0   1   1   1   1   1   1   1   1   1   0   0   0   0
Sepal.Width    0   0   0   1   0   0   0   0   0   0   0   0   0   0   0   0
Petal.Length   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
Petal.Width    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
             V84 V85 V86 V87 V88 V89 V90 V91 V92 V93 V94 V95 V96 V97 V98 V99
Sepal.Length   1   0   1   1   1   0   0   0   1   0   0   0   0   0   1   0
Sepal.Width    0   0   1   1   0   0   0   0   0   0   0   0   0   0   0   0
Petal.Length   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
Petal.Width    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
             V100 V101 V102 V103 V104 V105 V106 V107 V108 V109 V110 V111 V112
Sepal.Length    0    1    0    1    1    1    1    0    1    1    1    1    1
Sepal.Width     0    1    0    0    0    0    0    0    0    0    1    1    0
Petal.Length    1    1    1    1    1    1    1    1    1    1    1    1    1
Petal.Width     1    1    1    1    1    1    1    1    1    1    1    1    1
             V113 V114 V115 V116 V117 V118 V119 V120 V121 V122 V123 V124 V125
Sepal.Length    1    0    0    1    1    1    1    1    1    0    1    1    1
Sepal.Width     0    0    0    1    0    1    0    0    1    0    0    0    1
Petal.Length    1    1    1    1    1    1    1    1    1    1    1    1    1
Petal.Width     1    1    1    1    1    1    1    1    1    1    1    1    1
             V126 V127 V128 V129 V130 V131 V132 V133 V134 V135 V136 V137 V138
Sepal.Length    1    1    1    1    1    1    1    1    1    1    1    1    1
Sepal.Width     1    0    0    0    0    0    1    0    0    0    0    1    1
Petal.Length    1    1    1    1    1    1    1    1    1    1    1    1    1
Petal.Width     1    1    1    1    1    1    1    1    1    1    1    1    1
             V139 V140 V141 V142 V143 V144 V145 V146 V147 V148 V149 V150
Sepal.Length    1    1    1    1    0    1    1    1    1    1    1    1
Sepal.Width     0    1    1    1    0    1    1    0    0    0    1    0
Petal.Length    1    1    1    1    1    1    1    1    1    1    1    1
Petal.Width     1    1    1    1    1    1    1    1    1    1    1    1
             threshold p.value
Sepal.Length      5.85   0.915
Sepal.Width       3.05   0.680
Petal.Length      2.45   0.001
Petal.Width       0.80   0.001

Binarize documentation built on May 1, 2019, 7:05 p.m.