missingLevel | R Documentation |
In data frames with factor variables, convert any observation with "" into <NA>.
missingLevel(data)
data |
a data frame with factor variables. |
In a factor variable with the level """"
, this command will convert
this to an <NA>
.
Returns the same data frame with """"
replaced by <NA>
in factor variables.
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.
Laura Chihara
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.