我有一些代码(如下)可以很好地为 ACS 调查 2013/14/15/16/17 获取某个地理区域(亚特兰大如下示例)的人口普查块组数据。但是,当我在 2012 年或之前运行它时,我收到以下错误。
从 2008-2012 5 年 ACS 错误中获取数据:您的 API 调用有错误。返回的 API 消息是错误:未知/不支持的地理层次结构。
atl_counties <- c("Barrow",
"Bartow",
"Butts",
"Carroll",
"Cherokee",
"Clayton",
"Cobb",
"Coweta",
"Dawson",
"DeKalb",
"Douglas",
"Fayette",
"Forsyth",
"Fulton",
"Gwinnett",
"Haralson",
"Heard",
"Henry",
"Jasper",
"Lamar",
"Meriwether",
"Morgan",
"Newton",
"Paulding",
"Pickens",
"Pike",
"Rockdale",
"Spalding",
"Walton")
atl_vars_short <- c(
total_pop = "B01003_001",
median_income = "B19013_001",
households = "B11001_001",
housing_units = "B25001_001",
agg_hh_income ="B19025_001"
)
# This works
cbg_data_atl_2013 <- get_acs(geography = "block group",
variables = atl_vars_short,
state ='GA',
county = atl_counties,
year = 2013,
geometry = FALSE)
# This does not work
cbg_data_atl_2012 <- get_acs(geography = "block group",
variables = atl_vars_short,
state ='GA',
county = atl_counties,
year = 2012,
geometry = FALSE)