r - Incorrect ISO codes in gvisGeoChart? -
i started using googlevis in r, , running trouble. want make choropleth map of departments of honduras; here's code:
map_me <- data.frame(prov=c("hn-at","hn-ch","hn-cl","hn-cm","hn-cp","hn-cr", "hn-ep","hn-fm","hn-gd","hn-ib","hn-in","hn-le", "hn-lp","hn-oc","hn-ol","hn-sb","hn-va","hn-yo"), x=c(0.47,0.32,0.31,0.25,0.24,0.41,0.40,0.38,0.43,0.29, 0.17,0.25,0.33,0.17,0.19,0.39,0.21,0.31)) g <- gvisgeochart(map_me,locationvar='prov',colorvar='x', options=list(region="hn",datamode="regions")) plot(g) in browser window pops up, map correctly zoomed-in on honduras , color scale in legend shows right limits (0.17-0.47). think have correct iso 3116-2 codes, based on wikipedia entry, seems having trouble connecting data map locations.
any ideas?
when else fails, read vignette. turns out needed set correct resolution option:
g <- gvisgeochart(map_me,locationvar='prov',colorvar='x', options=list(region="hn",resolution="provinces"))
Comments
Post a Comment