【发布时间】:2015-10-14 15:47:09
【问题描述】:
我正在寻找一种在 R 中的美国地图上为县着色的方法。我有可以作为参数输入的数字/字符县 FIPS 代码列表。我只需要突出显示这些县 - 所以只需要对它们进行阴影处理,并且没有与县相对应的值或变化。我试着查了一下
library(choroplethr)
library(maps)
和
county_choropleth(df_pop_county)
head(df_pop_county)
region value
1 1001 54590
2 1003 183226
3 1005 27469
4 1007 22769
5 1009 57466
6 1011 10779
但这些需要一个区域、值对。例如,上面的 fips 代码和人口。有没有一种方法可以调用 County_choropleth 函数而不必使用这些值,只需使用 fipscode 数据框。这样,我可以用一种颜色对我的 fips 编码。在 R 中使用 Choroplethr 完成此任务的有效方法是什么?
【问题讨论】:
-
rworldmap知道 FIPS:inside-r.org/packages/cran/rworldmap/docs/country2Region
标签: r maps fips choroplethr rmaps