if (FALSE) {
clean_labels("-_-This is; A WeÏrD**./sêntënce...")
clean_labels("-_-This is; A WeÏrD**./sêntënce...", sep = ".")
input <- c("Peter and stëven",
"peter-and.stëven",
"pëtêr and stëven _-")
input
clean_labels(input)
# Don't transliterate non-latin words
clean_labels(input, transformation = "Latin-ASCII")
# protect useful symbols
clean_labels(c("energy > 9000", "energy < 9000"), protect = "><")
# if you only want to clean accents, transform to lower, and transliterate,
# you can specify "[:punct:][:space:]" for protect:
clean_labels(input, protect = "[:punct:][:space:]")
# appropriately transliterate Germanic umlaute
if (stringi::stri_info()$ICU.system) {
# This will only be true if you have the correct version of ICU installed
clean_labels("'é', 'ê' and 'è' become 'e', 'ö' becomes 'oe', etc.",
transformation = "Any-Latin; de-ASCII; Latin-ASCII")
}
}
Run the code above in your browser using DataLab