Created
August 17, 2016 04:46
-
-
Save tgjc/3f62450ae0f7e54e115eb26a93a05fb3 to your computer and use it in GitHub Desktop.
R dplyr: rename variables using string functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DATA %>% rename_(.dots=setNames(names(.), tolower(gsub("FROM", "TO", names(.))))) | |
| ## Taken from: http://stackoverflow.com/questions/30382908/r-dplyr-rename-variables-using-string-functions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment