-
-
Save lurodrigo/c0b7bd9590bc6e0ade00016010f0a29b to your computer and use it in GitHub Desktop.
Multiple summarise() statements
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
ms = function(.data, ...) { | |
dots = quos(...) | |
map(dots, ~ call_modify(., .data = .data) %>% eval_tidy()) %>% | |
reduce(function(tb1, tb2) { | |
for (newcol in setdiff(names(tb2), names(tb1))) { | |
tb1[[newcol]] = tb2[[newcol]] | |
} | |
tb1 | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment