fct_other | R Documentation |
Manually replace levels with "other"
fct_other(f, keep, drop, other_level = "Other")
f |
A factor (or character vector). |
keep, drop |
Pick one of
|
other_level |
Value of level used for "other" values. Always placed at end of levels. |
fct_lump()
to automatically convert the rarest (or most
common) levels to "other".
x <- factor(rep(LETTERS[1:9], times = c(40, 10, 5, 27, 1, 1, 1, 1, 1))) fct_other(x, keep = c("A", "B")) fct_other(x, drop = c("A", "B"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.