Group by , summarise, sort on summary data, append ranking from the sorting - dplyr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ds %>% group_by(group1, group2) %>% | |
summarise( | |
summary_value = some_function | |
) %>% arrange(desc(summary_value)) %>% group_by(group1) %>% | |
mutate(rank=row_number()) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment