powered by
Fixes if a factor list does not have named levels or has special characters in the names
fix_name_labels(x, pattern = NA, replacement = ".")
a named list with fixed names
the vector or list to fix
regex pattern to replace; defaults to non-word characters and the value of faux_options("sep") (default = _)
the character to replace; defaults to . (or _ if faux_options("sep") == ".")
source <- list("full.stop", " space ", "under_score", "plus+", "dash-", "tab\t", "line\nbreak") fix_name_labels(source)
Run the code above in your browser using DataLab