let's say i have a lot of columns, but i usually do some calculations on a specific subset of columms
my_df <- mtcars %>%
filter(if_all(contains("p"), is.numeric)) %>%
mutate(across(contains("p"), as.character))
i want to assign that tidy-select to a variable so i can use it later on, something like:
# doesn't work
my_cols <- contains("p")
my_df <- mtcars %>%
filter(if_all(my_cols, is.numeric)) %>%
mutate(across(my_cols, as.character))
many thanks