Skip to contents

asciify() 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.

Usage

asciify(x)

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

Other functions for initial data processing: load_config(), reformat_data()

Examples

asciify(c("Fr\u00E5nppn", "Avf\u00E4rdsdatum"))
#> [1] "Franppn"      "Avfardsdatum"
asciify(c("a and b", "a-and-b"))
#> [1] "a.and.b"   "a.and.b.1"