Can dplyr summarise over several variables without listing each one? [duplicate]

As has been mentioned by several folks, mutate_each() and summarise_each() are deprecated in favour of the new across() function.

Answer as of dplyr version 1.0.5:

df %>%
  group_by(sex) %>%
  summarise(across(everything(), mean))

Original answer:

dplyr now has summarise_each:

df %>% 
  group_by(sex) %>% 
  summarise_each(funs(mean))

Leave a Comment