rm_accent Function to remove accents from words

rm_accent(str, pattern = "all")

Arguments

str

vector of strings that will have their accents removed.

pattern

string vector with one or more elements indicating which accents should be removed. To indicate which accents should be removed, a vector with the symbols should be passed. Example: pattern = c("´", "^") will strip out the acute and caret accents only. Other accepted words: "all" (remove all accents, which are "´", "`", "^", "~", "¨", "ç")

Value

vector without accent

Examples

x <- "São Paulo" y <- rm_accent(x, pattern = "'") print(y)
#> [1] "São Paulo"
y <- rm_accent(x, pattern = "~") print(y)
#> [1] "Sao Paulo"
y <- rm_accent(x, pattern = "all") print(y)
#> [1] "Sao Paulo"