Created
March 25, 2016 16:54
-
-
Save apreshill/b22ea59a3fc7086b3acd to your computer and use it in GitHub Desktop.
This file contains 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
# convert all column names to snake case | |
# make all column names lower case | |
# replace all . with _ | |
names2snake <- function(data){ | |
require(stringr) | |
require(dplyr) | |
names(data) = names(data) %>% | |
tolower() %>% | |
str_replace_all(., "[.]", "_") | |
data | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment