Geographical heat map in R

2019-01-22 04:05发布

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.

标签: r map
3条回答
【Aperson】
2楼-- · 2019-01-22 04:23

(hopefully answer may still be helpful for somebody)

RevolutionAnalytics has excellent example of map visualization using spplot() function. Here's image from there:

enter image description here

查看更多
看我几分像从前
3楼-- · 2019-01-22 04:28

There is a complete example in the ggplot2 package, see ?map_data.

library(ggplot2)
example(map_data)
查看更多
别忘想泡老子
4楼-- · 2019-01-22 04:38

There is a population-driven cloropleth example in the UScensus2000tract package.

查看更多
登录 后发表回答