-
-
Save klmr/8272092170d0b19d98e5eb44fc9cec9f to your computer and use it in GitHub Desktop.
Summarise a simple table in < 5 lines of code #so
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
readr::read_csv(input_filename) %>% | |
dplyr::group_by(drug_name) %>% | |
dplyr::summarize(num_prescriber = n(), total_cost = sum(drug_cost)) %>% | |
readr::write_csv(output_filename) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment