fct_nanify | R Documentation |
The inverse of fct_explicit_na()
. Turns the level
into proper NA
.
Retains the level.
fct_nanify(f, level, negate = FALSE, ignore_case = TRUE)
f |
factor to work on |
level |
character, regular expression matching the desired level |
negate |
logical, whether to return non-matching elements. Defaults to
|
ignore_case |
logical, ignore case when matching? Defaults to |
factor with NA-substituted level.
f <- factor(c("a", "b", "c", "nanify"))
fct_nanify(f, "nanify")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.