R/phenoDataFrame.R

Defines functions `phenoDataFrame`

`phenoDataFrame` <-
function(PhenoData, variableClass) {

PhenoInfo=PhenoData

for(i in 1:length(variableClass)) { 

             if(variableClass[i] == "numeric")  {PhenoInfo[,i] <- as.numeric(as.vector(PhenoData[,i]))
}
    else       
            if(variableClass[i] == "character") {
    PhenoInfo[,i] <- as.character(as.vector(PhenoData[,i]))
                 } 
else
if(variableClass[i] == "factor") {

     PhenoInfo[,i] <- factor(as.character(as.vector(PhenoData[,i])))           
         } 
   
PhenoInfo = PhenoInfo             
} 

PhenoInfo 
}

Try the clippda package in your browser

Any scripts or data that you put into this service are public.

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