View source: R/factor_NA2missing.R
factor_NA2missing | R Documentation |
Set NA values of a factor vector to a new level indicating missingness
factor_NA2missing(x, na_level_name = "missing")
x |
Factor |
na_level_name |
Character: Name of new level to create that will be assigned to all current NA values. Default = "missing" |
E.D. Gennatas
x <- factor(sample(letters[1:3], 100, TRUE))
x[sample(1:100, 10)] <- NA
xm <- factor_NA2missing(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.