I'm wondering if there's an obvious shorthand for applying a bunch of functions across the whole dataset, that is shorthand for across(everything(), ...)
. Solution does not have to use dplyr.
Note that
! Using `across()` without supplying `.cols` was deprecated in dplyr 1.1.0.
Example
library(dplyr)
mtcars |> summarize(across(everything(), list(min, max)))
The end goal is something like this use case (but not only):
library(dplyr)
mtcars |>
summarize(across(everything(), lst(min, max))) |>
pivot_longer(everything(), names_to = c("var", ".value"), names_sep = "_")
# A tibble: 11 × 3
var min max
<chr> <dbl> <dbl>
1 mpg 10.4 33.9
2 cyl 4 8
3 disp 71.1 472
4 hp 52 335
5 drat 2.76 4.93
6 wt 1.51 5.42
7 qsec 14.5 22.9
8 vs 0 1
9 am 0 1
10 gear 3 5
11 carb 1 8
>
(NB: dplyr::lst()
gives you correct names.)