Description Usage Arguments Value Examples
Sets rare values of a factor to new value "other". Thus limits the number of factor levels.
1 | group.factor(x, top.values = 10, min.frequency = NA)
|
x |
data vector |
top.values |
number of bins to create (plus "other" group) |
min.frequency |
if factor value is less requent than this value, then put it to "other" group |
data frame with mapping (variable value) -> (variable group)
1 2 | df$var <- group.factor(df$var, top.values=10)
df$var <- group.factor(df$var, min.frequency=100)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.