我一直在尝试用没有等价字符的等价字符替换代字符/重音符(例如:á到a)。我正在将iconv函数与参数“ to = UTF-8 // TRANSLIT”或“ to = ASCII // TRANSLIT”一起使用,但是它不起作用...
这是我要调试的代码:
> colnames(rutas2)
[1] "Vehículo" "Día" "Hora de inicio"
> Encoding(colnames(rutas2))
[1] "UTF-8" "UTF-8" "unknown"
> iconv(colnames(rutas2), to="UTF-8//TRANSLIT")
[1] "VehÃÂculo" "DÃÂa" "Hora de inicio"
> iconv(colnames(rutas2), to="ASCII//TRANSLIT")
[1] "VehA-culo" "DA-a" "Hora de inicio"
能给我提些建议吗?
非常感谢
豪尔赫