Description Usage Arguments Value
View source: R/collapse_to_other.R
Collapases a vector into the n-1 most frequent categories with all other categories becoming "other"
1 | collapse_to_other(vect, n_categories, keep_numeric = TRUE)
|
vect |
a vector |
n_categories |
the total number of categories the returned vector will have |
keep_numeric |
if keep_numeric is TRUE and the vector is numeric, the other category will be specified as a numeric value of repeated 8's that's greater than the maximum value instead of a character value |
A vector
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.