Created
July 16, 2020 11:38
-
-
Save keithmcnulty/12b21b640583906b794178e49bc2607b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| mtcars %>% | |
| dplyr::group_by(cyl) %>% | |
| dplyr::summarise(across(starts_with("d"), | |
| list(mean = mean, median = median), | |
| .names = "{fn}_of_{col}")) | |
| #> # A tibble: 3 x 5 | |
| #> cyl mean_of_disp median_of_disp mean_of_drat median_of_drat | |
| #> <dbl> <dbl> <dbl> <dbl> <dbl> | |
| #> 1 4 105. 108 4.07 4.08 | |
| #> 2 6 183. 168. 3.59 3.9 | |
| #> 3 8 353. 350. 3.23 3.12 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment