Created
February 15, 2022 19:23
-
-
Save dwillis/52bfadf9ca8f8a685f2a8cca2ec7beeb 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
Sample template for basic filtering, mutate and group_by with count | |
```{r} | |
my_result <- original_data %>% | |
filter(some_column == "some value") %>% | |
mutate(some_column=str_to_title(some_column)) %>% | |
group_by(some_column) %>% | |
summarise(new_aggregate = n()) %>% | |
arrange(desc(new_aggregate)) | |
``` | |
```{r} | |
my_result <- original_data %>% | |
filter(some_column == "some value") %>% | |
mutate(some_column=str_to_title(some_column)) %>% | |
group_by(some_column) %>% | |
summarise(new_aggregate = sum(some_number_column)) %>% | |
arrange(desc(new_aggregate)) | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment