# several summary columns with arbitrary names
library(dplyr)
mtcars %>%
group_by(cyl, gear) %>% # multiple group columns
summarise(sum_hp = sum(hp), mean_mpg = mean(mpg)) # multiple summary columns
# summarise all columns except grouping columns using "sum"
mtcars %>%
group_by(cyl) %>%
summarise(across(everything(), sum))
# summarise all columns except grouping columns using "sum" and "mean"
mtcars %>%
group_by(cyl) %>%
summarise(across(everything(), list(mean = mean, sum = sum)))