discreteClasses: From continous to discrete classes.

Description Usage Arguments Value Examples

Description

From a continous version of covariates (columns) to 2 discrete classes.

From a discrete version of covariates (columns), following markAs1 the function creates the binary version.

From a matrix or data frame keeps onòy the first occurrence according to a column.

Usage

1
2
3
4
5
6
createBiClasses(coxObj, covs, doChecks = TRUE, labels = c("low",
  "high"), minprop = 0.1)

createBinaryMatrix(discrete, markAs1 = c("high", "TRUE"))

keepFirstOccurrence(m, whichCol)

Arguments

coxObj

cox like object with days and status plus covariates

covs

the covariates to use

doChecks

if TRUE perform checks on min proportion

labels

the labels of the two classes

minprop

minimal proportion

discrete

discrete version of the covariates (columns)

markAs1

the discrete values associated to 1

m

a matrix

whichCol

the column to select the first occurrence

Value

discrete version of the selected 'covs'.

binary matrix

matrix without duplicates.

Examples

1
2
3
4
5
6
7
  dummy <- matrix(c("high","high","low","TRUE","low","low","high","FALSE"), nrow=4)
  createBinaryMatrix(dummy)
  dummy <- matrix(c("a","b","a","c",1,2,3,4), nrow=4)
  colnames(dummy) <- c("gene", "value")
  keepFirstOccurrence(dummy,1)
  keepFirstOccurrence(dummy,"gene")
  

cavei/MOSClip documentation built on May 12, 2019, 5:22 p.m.