Description Usage Arguments Value Author(s) See Also Examples
Sort groups based on a function such as mean value or deviation.
1 | sortGroups(formula, FUN = "mean", decreasing = FALSE, ...)
|
formula |
Formula for splitting the data |
FUN |
Function to apply to each group |
decreasing |
Logical: sort groups on decreasing values or not (default is FALSE, sorting on increasing values). |
... |
Additional arguments for the function
|
The order of levels.
Jacolien van Rij
Other Utility functions:
findAbsMin(),
find_n_neighbors(),
firstLetterCap(),
getArrowPos(),
getDec(),
getRange(),
getRatioCoords(),
get_palette(),
group_sort(),
inch2coords(),
isColor(),
list2str(),
move_n_point(),
orderBoxplot(),
se()
1 2 3 4 5 | head(ToothGrowth)
# sort on basis of mean length:
sortGroups(len ~ dose:supp, data = ToothGrowth)
labels = levels(interaction(ToothGrowth$dose, ToothGrowth$supp))
labels[sortGroups(len ~ dose:supp, data = ToothGrowth)]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.