Reading accented filenames in R using list.files

不想你离开。 提交于 2020-01-01 12:17:11

问题


I am reading county geojson files provided here into R Studio (R 3.1, Windows 8) for each of the states. I am using list.files() function in R.

For state PR, which has many counties with accented (Spanish) names viz. Bayamón.geo.json, Añasco.geo.json. The function list.files() returns shortened form of file names like An~asco.geo.json, Bayamo´n.geo.json.

And when in the next step I try to read the actual file using above filenames. I get an error that these files don't exist.

I was using system default encoding ISO-8859-1 and also tried changing it to UTF-8, but no luck.

Please help me solve this issue. How can I read files with accented filenames?

来源:https://stackoverflow.com/questions/44370357/reading-accented-filenames-in-r-using-list-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!