Last active
February 12, 2018 12:14
-
-
Save klmr/f42ba1b56d485e44f31efd116b400a2e to your computer and use it in GitHub Desktop.
Summarise a column in a (grouped) tibble
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
summary.tbl_df = function (object, ...) { | |
dots = rlang::quos(...) | |
stopifnot(length(dots) == 1) | |
name = rlang::quo_name(dots[[1]]) | |
do(object, as_data_frame(as.list(summary(.[[name]])))) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment