[R-sig-Geo] readOGR and writeOGR: encoding?

Roland Kaiser roland.kaiser at sbg.ac.at
Sat Mar 21 16:03:43 CET 2009


You can try something like this

shp <- readOGR()
df <- apply(shp at data, 2, as.character) # if options 
("stringsAsFactors") is TRUE
Encoding(df) <- "latin1"
shp at data <- as.data.frame(df)

Roland

> Hi!
>
> Is there any way to read the dbf of shp files that contain
> non-ascii characters? I've tried with encoding="UTF-8"
> or latin3 as for scan, but this argument does not exist for
> readOGR (or writeOGR)
>
> Agus
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo



More information about the R-sig-Geo mailing list