View source: R/anyMissingLevels.R
anyMissingLevels | R Documentation |
This function determines whether any level of a categorical predictor variable has completely missing outcome data.
anyMissingLevels( yname, cat.vars, dataset)
yname |
A character string indicating the outcome variable, i.e., a metabolite. |
cat.vars |
A character vector of categorical variable names. |
dataset |
A data frame containing the yname and cat.vars variables. |
Returns a list indicating whether each of the variables specified in argument cat.vars has at least one level with completely missing values for the outcome variable specified in yname.
Michael Nodzenski
#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 anyMissingLevels( "aspartic_acid", c( "batch", "pheno"), example.data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.