missingLevel {CarletonStats}R Documentation

Missing observations in factors

Description

In data frames with factor variables, convert any observation with "" into <NA>.

Usage

missingLevel(data)

Arguments

data

a data frame with factor variables.

Details

In a factor variable with the level """", this command will convert this to an <NA>.

Value

Returns the same data frame with """" replaced by <NA> in factor variables.

Note

When importing data from comma separated files (for example), missing values in a categorical variable are often denoted by """. We often do not want to treat this as a level of a factor variable in R.

Author(s)

Laura Chihara


[Package CarletonStats version 2.2 Index]