i want to create a map of the US in R with the states color coded in a heat map type of way based on a metric. I know how to do this using the googleVis api but i can't use the code and without the rollovers it's not that great. what is the quickest way to get this done? i'm familiar with the maps package but i can't get the colors to cooperate. i believe this is called a choropleth map.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
There is a complete example in the ggplot2 package, see ?map_data
.
library(ggplot2)
example(map_data)
回答2:
(hopefully answer may still be helpful for somebody)
RevolutionAnalytics has excellent example of map visualization using spplot()
function. Here's image from there:
回答3:
There is a population-driven cloropleth example in the UScensus2000tract package.