library(tidycensus)
# no error
get_acs("county subdivision", variables = "B01003_001", state = "09", year = 2010, county = "09")
#> Getting data from the 2006-2010 5-year ACS
#> # A tibble: 28 x 5
#> GEOID NAME variable estimate moe
#> <chr> <chr> <chr> <dbl> <dbl>
#> 1 0900900… County subdivisions not defined, New… B01003_0… 0 123
#> 2 0900901… Ansonia town, New Haven County, Conn… B01003_0… 19163 45
#> 3 0900903… Beacon Falls town, New Haven County,… B01003_0… 5909 18
#> 4 0900904… Bethany town, New Haven County, Conn… B01003_0… 5467 34
#> 5 0900907… Branford town, New Haven County, Con… B01003_0… 28194 31
#> 6 0900914… Cheshire town, New Haven County, Con… B01003_0… 29183 25
#> 7 0900919… Derby town, New Haven County, Connec… B01003_0… 12826 20
#> 8 0900922… East Haven town, New Haven County, C… B01003_0… 29074 26
#> 9 0900934… Guilford town, New Haven County, Con… B01003_0… 22222 35
#> 10 0900935… Hamden town, New Haven County, Conne… B01003_0… 60293 32
#> # ... with 18 more rows
# error on geography hierarchy
get_acs("county subdivision", variables = "B01003_001", state = "09", year = 2010)
#> Getting data from the 2006-2010 5-year ACS
#> Error: Your API call has errors. The API message returned is error: unknown/unsupported geography heirarchy.
Created on 2018-11-11 by the reprex package (v0.2.1)