Convert character strings to unique, ASCII-compliant, and syntactically valid column names
asciify.Rdasciify() replaces non-ASCII punctuation, symbols, and Latin letters with
approximate ASCII-range equivalents, and ensures that resulting character
strings are unique and syntactically valid column names.
Arguments
- x
Character vector to be coerced to unique, ASCII-compliant, and syntactically valid names. This is coerced to character if necessary.
Value
Character vector of the same length as x, with each changed to a
unique, ASCII-compliant and syntactically valid name.
Details
This helper function is used within load_config() and
reformat_data() to avoid potential issues with accents and other
non-ASCII symbols in data file column headers.
See also
stringi::stri_trans_general()and https://unicode-org.github.io/icu/userguide/transforms/general/#icu-transliterators for the underlying process of making names ASCII-compliant.make.names()for the underlying process of making names syntactically valid and unique.
Other functions for initial data processing:
load_config(),
reformat_data()