NAtoCategory | R Documentation |
Extract all the missing values in a factor variable and turn them into a separate category.
NAtoCategory(fact, label = "missing")
fact |
Factor variable. |
label |
Label to be given to the missing valus. |
Updated factor variable.
Kaspar Rufibach (maintainer), kaspar.rufibach@gmail.com,
http://www.kasparrufibach.ch
set.seed(1977)
fact <- factor(sample(c(round(runif(10, 1, 3)), rep(NA, 10))), levels = 1:3,
labels = c("no", "maybe", "yes"))
NAtoCategory(fact)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.