I am trying to use multiple sources of German/Swiss data with umlauts in it. When trying to merge, I realized that the umlauts do not display correctly in R and the same names were rendered differently in different files.
map <-readOGR("/path/to/data.gdb", layer = "layer")
map@data$name
# [1] L\303\266rrach
# [2] Karlsruhe
# [3] ...
Along with several other posts, I read Encoding of German umlauts when using readOGR because one of my data sources is a shp file I read in with readOGR
.
Appending use_iconv = TRUE, encoding = "UTF-8")
to the end of readOGR
did not help. And the problem exists outside of the use of redOGR
. I saw that using Sys.setlocale()
and a locale which supports UTF-8 worked for that poster, but I don't know what that means after looking at the ?Sys.setlocale
information.
How do I correctly read in German data in R on a Mac using English? Sys.getlocale
reports C.