简体   繁体   中英

Downloading ACS data for state legislative districts using tidycensus::get_acs()

I'm trying to download 5-year ACS data for state legislative districts (both upper and lower). According to documentation for the get_acs() command, state legislative districts are a supported geography (see here ).

However, when I try to download data using the command, I get the following error message:

Error: Your API call has errors. The API message returned is error: unknown/unsupported geography heirarchy.

Here's a minimum working example that produces the above message:

tidycensus::get_acs(geography = "state legislative district (lower chamber)",
                    variables = "B05002_013E", year = 2014)

Any idea what's going on or how I can access ACS data for state legislative districts?

I received an answer on another site. Sharing in case anyone else is experiencing the same problem:

"From the documentation it looks like you need to supply a state to get_acs() for state legislative districts, so something like the following works for me:

test <- get_acs(geography = "state legislative district (lower chamber)", variables = "B05002_013E", year = 2014, state = "NY") "

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM