walkerke / tidycensus

Load US Census boundary and attribute data as 'tidyverse' and 'sf'-ready data frames in R
https://walker-data.com/tidycensus
Other
639 stars 100 forks source link

Using get_acs results in "The API message returned is error: unknown/unsupported geography heirarchy" error #398

Closed bcongelio closed 3 years ago

bcongelio commented 3 years ago

Hello -

I am attempting to run this with tidycensus:

inglewood <- tidycensus::get_acs(geography = "tract",
                     variables = c(race.white = "B02001_002",
                                   race.black = "B02001_003",
                                   race.asian = "B02001_005",
                                   race.hispanic = "B03002_012"),
                     year = 2015,
                     state = "CA",
                     county = "Los Angeles",
                     survey = "acs1") %>%
  mutate(year = 2015)

Doing so results in this error:

The 1-year ACS provides data for geographies with populations of 65,000 and greater.
Getting data from the 2016 1-year ACS
Using FIPS code '06' for state 'CA'
Using FIPS code '037' for 'Los Angeles County'
Error: Your API call has errors.  The API message returned is error: unknown/unsupported geography heirarchy.

Am I doing something wrong in terms of requesting something that is not available with the 1-year ACS?

walkerke commented 3 years ago

Hi @bcongelio - Census tracts are not available in the 1-year ACS. You'll need the 5-year ACS for that. The 1-year ACS only has data for geographic units with populations of 65,000 or larger, which means smaller geographies like block groups, tract, ZCTAs, etc. are not included, and only a subset of counties are available.