Intermediate-R
Intermediate-R copied to clipboard
funs vs lists on scoped verbs
per dplyr 0.8.x the "funs()" paramenter will be soft deprecated in favor of lists, so you may want, for longevity purposes, propose the new format on the *_{at,if,all} verbs
fns <- list(
centered = mean, # Function object
scaled = ~ . - mean(.) / sd(.) # Purrr-style lambda
)
mutate_if(iris, is.numeric, fns)
source: https://www.tidyverse.org/articles/2018/12/dplyr-0-8-0-release-candidate/