查找城市、州的都会区或县

Finding the Metropolitan Area or County for City, State

我在数据框中有以下数据:

... location           amount
... Jacksonville, FL   40
... Provo, UT          20
... Montgomery, AL     22
... Los Angeles, CA    34

我的数据集只包含 U.S。 [城市名称,州代码] 形式的城市,我没有邮政编码。

我想确定一个城市的任何一个县,以便使用 ggcounty (like here) 可视化我的数据。

我查看了 U.S. Census Bureau 的网站,但确实找不到 table 城市、州、县或类似信息。

假设我更喜欢只在 R 中解决问题,谁知道如何解决这个问题?

执行此操作可以获得邮政编码和更多详细信息:

library(ggmap)
revgeocode(as.numeric(geocode('Jacksonville, FL ')))

希望对您有所帮助