phenoDataFrame {clippda} | R Documentation |
A function to set classes (e.g. as numeric or factor) to the variables in the dataframe.
phenoDataFrame(PhenoData, variableClass)
PhenoData |
is the dataframe of phenotypic information extracted from an |
variableClass |
a character vector of length equal to the number of columns of the dataframe of phenotypic information, giving classes of the variables studied. |
A dataframe of class-corrected phenotypic variables.
Stephen Nyangoma
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)