Open JoGall opened 6 years ago
hey! was doing something similar at work so thought I might throw in a few functions that might help:
showNonASCII()
and showNonASCIIfile()
, this is more for examining scripts and not data but might be usefulreplace_non_ascii()
stri_trans_general(x, "latin-ascii")
might be the best way to do it. Use it inside a mutate()
to transform the column containing the player names!x <- c(
"Hello World", "6 Ekstr\xf8m", "J\xf6reskog", "bi\xdfchen Z\xfcrcher",
'This is a \xA9 but not a \xAE', '6 \xF7 2 = 3',
'fractions \xBC, \xBD, \xBE', 'cows go \xB5', '30\xA2')
data.frame(thingy = x) %>%
mutate(thingy2 = stringi::stri_trans_general(thingy, "latin-ascii"))
Thanks for this Ryo, super useful! Hopefully finally get round to fixing this today.
Parse non-ASCII characters in StatsBomb (and other) data for use with
soccerPosition
and other future plotting functions. For example,Kylian Mbappé
currently renders asKylian Mbappé
.