Last active
September 27, 2021 18:38
-
-
Save dwillis/8c3b668c16bd5ee201cb278e273b8af4 to your computer and use it in GitHub Desktop.
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
my_data %>% | |
mutate( | |
category = case_when( | |
amount < 10000 ~ 'under_10k', | |
amount < 50000 ~ '10k_50k', | |
amount < 100000 ~ '50k_100k', | |
amount < 500000 ~ '100k_500k', | |
amount < 1000000 ~ '500k_1m', | |
amount > 1000000 ~ '1m_plus' | |
) | |
) %>% | |
group_by(category) %>% | |
summarise(count = n()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment