Replacement for "rename" in dplyr

vergilcw picture vergilcw · Feb 1, 2014 · Viewed 153.7k times · Source

I like plyr's renaming function rename. I have recently started using dplyr, and was wondering if there is an easy way to rename variables using a function from dplyr, that is as easy to use as to plyr's rename?

Answer

aaronwolen picture aaronwolen · Oct 1, 2014

dplyr version 0.3 added a new rename() function that works just like plyr::rename().

df <- rename(df, new_name = old_name)