binarize: Binarize

Description Usage Arguments Details Author(s) Examples

View source: R/binarize.r

Description

Methods to convert a real matrix to a binary matrix.

Usage

1
2
3
binarize(x, threshold=NA)
binarizeByPercentage(x,percentage, error=0.2, gap=0.1)
densityOnes(x)

Arguments

x

The data matrix to be binarized.

threshold

Threshold used to binarize. Values over threshold will be set to 1, the rest to 0. If threshold is NA, median is used as threshold. Default NA.

percentage

Percentage of ones against zeros desired in the binary matrix.

error

Percentage of ones against zeros in the final matrix will be in [percentage-error, percentage+error]. Default 0.2

gap

Value used for incremental search of threshold. Default 0.1

Details

The binarize function returns a matrix binarized by input threshold, or by the median if no threshold is given.

The binarizeByPercentage function returns a matrix binarize by input percentage, given as desired density of ones against zeros.

The densityOnes function returns the percentage of ones against zeros in a logical matrix

Author(s)

Rodrigo Santamaria rodri@usal.es

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11

Example output

Loading required package: MASS
Loading required package: grid
Loading required package: colorspace
Loading required package: lattice
[1] "Threshold:  0.3969381"
[1] "Threshold applied is  1.6969381"
[1] 4.813637
[1] 48.28859
[1] 28.06183

biclust documentation built on May 31, 2017, 4:22 a.m.

Search within the biclust package
Search all R packages, documentation and source code