phenoDataFrame: A generic function to set classes for the variables in the...

Description Usage Arguments Value Author(s) Examples

Description

A function to set classes (e.g. as numeric or factor) to the variables in the dataframe.

Usage

1
phenoDataFrame(PhenoData, variableClass)

Arguments

PhenoData

is the dataframe of phenotypic information extracted from an object of class aclinicalProteomicsData.

variableClass

a character vector of length equal to the number of columns of the dataframe of phenotypic information, giving classes of the variables studied.

Value

A dataframe of class-corrected phenotypic variables.

Author(s)

Stephen Nyangoma

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
data(liverdata)

data(liver_pheno)

OBJECT=new("aclinicalProteomicsData")

OBJECT@rawSELDIdata=as.matrix(liverdata)
OBJECT@covariates=c("tumor" ,    "sex")
OBJECT@phenotypicData=as.matrix(liver_pheno)
OBJECT@variableClass=c('numeric','factor','factor')
OBJECT@no.peaks=53

Data=OBJECT
variableClass =Data@variableClass

variables = c("SampleTag","tumor","sex")

PhenoInfo <- data.frame(Data@phenotypicData)

PhenoData <- data.frame(Data@phenotypicData)

pData=phenoDataFrame(PhenoData, variableClass) 

class(pData$sex)
class(pData$SampleTag)
class(pData$tumor)

clippda documentation built on Nov. 8, 2020, 8:13 p.m.