lump | R Documentation |
Takes levels (labels, factor levels) and corresponding counts and "lumps" according to specified criteria (either n or prop), i.e. preserves some rows and summarises the rest in a single "Other" row
lump( levels, count, n, prop, other_level = "Other", ties.method = c("min", "average", "first", "last", "random", "max") )
levels |
Vector of levels |
count |
Vector of corresponding counts |
n |
If specified, n rows shall be preserved. |
prop |
If specified, rows shall be preserved if their count >= prop |
other_level |
Name of the "other" level to be created from lumped rows |
ties.method |
Method to apply in case of ties |
A dictionary (named vector) of levels -> new levels
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.