I am having difficulty renaming columns in a function using dplyr. I have already found helpful posts on nonstandard evaluation and the use of enquo (e.g., http://dplyr.tidy
Use := if you want programmatically-assigned names on the LHS of expressions.
:=
x <- "mpg" xnew <- "mpg2" rename(mtcars, !!xnew := !!rlang::sym(x))