Open northeastloon opened 4 years ago
I was going to ask something related, but for var_labels
, if not implemented yet. The recent update dplyr 1.0.0
has come with the new function across
, with which we could do something like:
... %>%
var_labels(across(c(a set of variables), ~function on (.)))
which would be very useful if from the variables we could get their names.
Thank you!
Actually, I found it is possible to work with across like this:
data %>%
mutate(across(starts_with("MDD"), ~sjlabelled::set_label(., "Depression")))
set_labels appears to only offer limited support for tidy select helpers. While 'çontains' and 'starts_with', work, others such as 'any_of', 'where' and 'matches' are not recognised.