Summarizing multiple columns with dplyr? [duplicate]
In dplyr (>=1.00) you may use across(everything() in summarise to apply a function to all variables: library(dplyr) df %>% group_by(grp) %>% summarise(across(everything(), list(mean))) #> # A tibble: 3 x 5 #> grp a b c d #> <int> <dbl> <dbl> <dbl> <dbl> #> 1 1 3.08 2.98 2.98 2.91 #> 2 2 3.03 3.04 2.97 … Read more