| clean_names {janitor} | R Documentation |
Resulting names are unique and consist only of the _ character, numbers, and letters.
Capitalization preferences can be specified using the case parameter.
Accented characters are transliterated to ASCII. For example, an "o" with a German umlaut over it becomes "o", and the Spanish character "enye" becomes "n".
clean_names(dat, case = c("snake", "lower_camel", "upper_camel",
"screaming_snake", "lower_upper", "upper_lower", "all_caps",
"small_camel", "big_camel", "old_janitor", "parsed", "mixed"))
dat |
the input data.frame. |
case |
The desired target case (default is
|
Returns the data.frame with clean names.
# not run:
# clean_names(poorly_named_df)
# or pipe in the input data.frame:
# poorly_named_df %>% clean_names()
# if you prefer camelCase variable names:
# poorly_named_df %>% clean_names(., "small_camel")
# not run:
# library(readxl)
# readxl("messy_excel_file.xlsx") %>% clean_names()