In dplyr verbs, I understand how to unquote a column name given as a character in the environment:
var <- "height" starwars %>% transmute(test = !!sym(var)) # or starwars %>% transmute(test = .data[[var]])
But what if the column name is given in another column in the same tibble? E.g.:
starwars %>% mutate(selected.var = "height") %>% transmute(test = !!sym(selected.var)) # Error in is_symbol(x) : object 'selected.var' not found
(Intended output would be the same as the two examples above.) I don't see this use-case covered in the programming vignette, and I'm seeing that the tidyeval book is no longer current. Apologies if I've missed this in the documentation.