问题
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