Is there a clever way to use the rename function in dplyr when in some instances the column to be renamed doesn\'t exist?
For example, I would like the following not to
The plyr package has a rename() function with a warn_missing parameter.
warn_missing
plyr::rename( mtcars, replace = c(mpg="miles_per_gallon", foo="missing_varible"), warn_missing = FALSE )
If you use it, consider using requireNamespace() instead of library(), so its function names don't collide with dplyr's.
requireNamespace()
library()