powered by
Used inside mutate() or summarise() to apply a function to multiple columns selected with tidyselect. Returns a named list of expressions.
mutate()
summarise()
across(.cols, .fns, ..., .names = NULL)
A named list used internally by mutate/summarise.
Column selection (tidyselect).
A function, formula, or named list of functions.
Additional arguments passed to .fns.
.fns
A glue-style naming pattern. Uses {.col} and {.fn}. Default: "{.col}" if .fns is a single function, "{.col}_{.fn}" if .fns is a named list.
{.col}
{.fn}
"{.col}"
"{.col}_{.fn}"
f <- tempfile(fileext = ".vtr") write_vtr(mtcars, f) # In summarise (conceptual; across is expanded to individual expressions) unlink(f)
Run the code above in your browser using DataLab