Description Usage Arguments Value Author(s) Examples
View source: R/allMissingLevels.R
This function determines metabolite data are present for at most one level of a categorical predictor variable, and thus whether that predictor needs to be removed from the mixture model.
1 | allMissingLevels(missing.levels.list, dataset)
|
missing.levels.list |
A list output by function idMissingLevels indicating which categorical variables have no corresponding metabolite data for at least one level. |
dataset |
A data frame containing the variables specified in missing.levels.list. |
Returns a list indicating whether categorical variables in missing.levels.list have metabolite data present for at most one level.
Michael Nodzenski
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #create example analysis data
data(euMetabCData)
example.data<-euMetabCData
example.data[example.data$batch==1, "aspartic_acid"]<-NA
#check to determine if aspartic acid values are entirely missing for
#any level of batch or pheno
missing.levels.check<-lapply( "aspartic_acid", anyMissingLevels, cat.vars=c("pheno", "batch"), dataset=example.data)
names(missing.levels.check)<-"aspartic_acid"
missing.levels.check
#find the specific missing level
missing.level.ids<-idMissingLevels( "aspartic_acid", missing.levels.check, example.data)
#check to see if those variables have completely missing data
allMissingLevels(missing.level.ids, example.data)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.