You bring up good points. Your code is already abstracted and so is easy to change, and easy to refactor as functions.
quo_name()
is not meant for transforming quosured symbols to strings. It's a general purpose deparser that should only be used for creating default names. With rlang 0.3.0, the help page of ?quo_name
makes this point clearer.
If you're manipulating column names, you don't need any quosure at all actually. So your workflow of using lists of symbols and using as.character()
with functions taking strings is good.
Are there any plans for the *_join() functions to pick up support for lists of symbols in the by parameter?
I was thinking about that recently. I think the by
parameter could be treated like the .vars
parameter of mutate_at()
, summarise_at()
etc. Then you could either pass a character vector or a vars()
specification:
df %>% left_join(df2, by = vars(starts_with("s")))
I have posted an issue: Should `by` parameters of join functions support vars() specifications? · Issue #3965 · tidyverse/dplyr · GitHub