eglenn / acs

acs package in R / download, manage, analyze, and present data from the U.S. Census in R
3 stars 0 forks source link

acs.fetch failure for 2017 5-year file #4

Open AnastasiiaFR opened 5 years ago

AnastasiiaFR commented 5 years ago

It might be an easy issue to troubleshoot but all my trials failled...

I am trying to use API to extract population block groups data from 2017 B01003- Total population table released yesterday.

However, i get the following message:

Error in file(file, "rt") : cannot open the connection In addition: Warning messages: 1: In (function (endyear, span = 5, dataset = "acs", keyword, table.name, : acs.lookup for endyear>2015: using 2015 variable codes to access 2017 data. (See ?acs.lookup for details) 2: No data found at: https://api.census.gov/data/2017/acs/acs5?key=0e31735c9ff1c2a712d6012c70f5484b53741f98&get=B01003_001E,B01003_001M,NAME&for=block+group:*&in=state:25+county:019+tract:*

Could you kindly suggest on the ways to solve the issue? Thank you in advance!

eglenn commented 5 years ago

Thanks for the email. From what I can tell, the API is not supporting requests with wildcards ("*") for both tracts and block groups (i.e., all block groups in all tracts in a county). The API has been sort of inconsistent in this respect -- I think technically they only every promised that you could use wildcards for the smallest level of geography, but sometimes it seems to accept other options.

So, for example, the following code works for 2016:

acs.fetch(table.number="B01003", span=5, endyear=2016, geography=geo.make(state=25, county=19, tract="", block.group=""))

But fails for 2017:

acs.fetch(table.number="B01003", span=5, endyear=2017, geography=geo.make(state=25, county=19, tract="", block.group=""))

If you specify a tract, you can verify that the block group data is in fact there:

acs.fetch(table.number="B01003", span=5, endyear=2017, geography=geo.make(state=25, county=19, tract="950100", block.group="*"))

You can, however, use a trick to work around this -- see http://eglenn.scripts.mit.edu/citystate/2013/07/acs-r-example-downloading-all-the-tracts-in-a-county-or-state/ for the basic idea, and just apply it to get the block groups.

Hope that helps.

--Ezra

On Fri, 07 Dec 2018 06:18:17 -0500, Andy Cochran wrote:

[1 <text/plain; UTF-8 (7bit)>] [2 <text/html; UTF-8 (7bit)>] It might be an easy issue to troubleshoot but all my trials failled...

I am trying to use API to extract population block groups data from 2017 B01003- Total population table released yesterday.

However, i get the following message:

Error in file(file, "rt") : cannot open the connection In addition: Warning messages: 1: In (function (endyear, span = 5, dataset = "acs", keyword, table.name, : acs.lookup for endyear>2015: using 2015 variable codes to access 2017 data. (See ?acs.lookup for details) 2: No data found at: https://api.census.gov/data/2017/acs/acs5?key=0e31735c9ff1c2a712d6012c70f5484b53741f98&get=B01003_001E,B01003_001M,NAME&for=block+group:*&in=state:25+county:019+tract :*

Could you kindly suggest on the ways to solve the issue? Thank you in advance!

― You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.*

-- Ezra Haber Glenn, AICP
Department of Urban Studies and Planning
Massachusetts Institute of Technology
77 Massachusetts Ave., Room 7-346
Cambridge, MA 02139
eglenn@mit.edu
http://dusp.mit.edu/faculty/ezra-glenn
617.253.2024 (w)
617.721.7131 (c)