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
To rename multiple columns at once, you have to use !!!:
!!!
x <- c("mpg", "cyl") xnew <- paste(x, 2, sep = ".") names(x) <- xnew rename(mtcars, !!!x)