anyMissingLevels: A function to determine whether any level of a categorical...

Description Usage Arguments Value Author(s) Examples

View source: R/anyMissingLevels.R

Description

This function determines whether any level of a categorical predictor variable has completely missing outcome data.

Usage

1
anyMissingLevels( yname,  cat.vars,  dataset)

Arguments

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.

Value

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.

Author(s)

Michael Nodzenski

Examples

1
2
3
4
5
6
7
8
#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)

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