Bina: Discretized matrix

Description Usage Arguments Value Examples

Description

Discretizing a matrix of continuous value to binary value

Usage

1
Bina(data, cutoff = 2)

Arguments

data

A matrix which needs to be binary

cutoff

A numeric threshold. If the value in data is less than threshold, it is set as 0, otherwise 1.

Value

Binary matrix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(melanoma)
melanoma1=as.matrix(melanoma[,2:dim(melanoma)[2]])
row.names(melanoma1)=melanoma[,1]
Bina(melanoma1)
## The function is currently defined as
function (data, cutoff = 2) 
{
    data[data < cutoff] = 0
    data[data >= cutoff] = 1
    return(data)
  }

Fang0828/SCMarker documentation built on May 13, 2019, 12:51 p.m.