Description Usage Arguments Examples
Retains/sorts the n
largest levels of a character or
factor vector and converts the remaining levels to "Other"
.
1 | downfactor(x, y = rep(1, length(x)), n = 5)
|
x |
A character or factor vector. |
y |
A numeric vector used for aggregating and ordering factor levels. |
n |
Number of factor levels to retain. |
1 2 | downfactor(letters, n = 10)
downfactor(letters, seq_along(letters), n = 10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.