allMissingLevels: A function to determine whether metabolite levels are present...

Description Usage Arguments Value Author(s) Examples

View source: R/allMissingLevels.R

Description

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.

Usage

1
allMissingLevels(missing.levels.list, dataset)

Arguments

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.

Value

Returns a list indicating whether categorical variables in missing.levels.list have metabolite data present for at most one level.

Author(s)

Michael Nodzenski

Examples

 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)

metabomxtr documentation built on Nov. 8, 2020, 6:50 p.m.