-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Milestone
Description
by_cyl <- mtcars[1:5] %>% group_by(cyl)
by_cyl %>% summarise_all(mean)
by_cyl %>% summarise_if(is.numeric, mean)
by_cyl %>% summarise_at(cols(cyl, mpg, wt), funs(mean, median), na.rm = TRUE)
by_cyl %>% mutate_all(scale)
by_cyl %>% mutate_if(is.numeric, scale)
by_cyl %>% mutate_at(cols(cyl, mpg, wt), funs(scale, rescale01))
by_cyl %>% mutate_at(c("cyl", "mpg", "wt"), funs(scale, rescale01))
summarise_each()
and mutate_each()
would be deprecated in favour of this new approach. And this would replace (e.g) purrrr::dmap()
.
And cols would be something along the lines of:
cols <- function(...) eval(subsitute(alist(...)))
(but with a special class)
senakimkevinushey and cpsievert
Metadata
Metadata
Assignees
Labels
No labels