[acs-r] Error message in acs 2.0

Williams, Michael michael.williams at mpls.frb.org
Tue Apr 19 09:16:53 EDT 2016


Hi Jonah,

I’ve used this package a fair amount. I also wrote my own very basic package for using the census api for slightly different use cases. Long story short, whenever possible I’d suggest using the wildcard as Carl suggests. That results in one api call while if you query each individual tract, you’re making a call for each tract and the data will take considerably longer to pull (with more opportunities for connection errors). The acs package is essentially looping through each geography, downloading, and binding the results together.

After you’ve got all the tracts from the wildcard you can filter the results locally.




Michael Williams | Financial Analyst | Community Development | Federal Reserve Bank of Minneapolis | 612.204.5572 | www.minneapolisfed.org<http://www.minneapolisfed.org/>

From: acs-r-bounces at mit.edu [mailto:acs-r-bounces at mit.edu] On Behalf Of Ganz, Carl
Sent: Monday, April 18, 2016 7:43 PM
To: Jonah Newman <jnewman at chicagoreporter.com>; acs-r at mit.edu
Subject: Re: [acs-r] Error message in acs 2.0

Hello Jonah,

I have had similar problems when dealing with geographies with many elements. I am guessing that you generated your geo.set by passing a vector of desired census tracts rather than doing something like,

geo.set(state=”IL”, county=”Cook”, tract=”*”)

As a result, your geo.set list has 591 geo objects. From my experience, any geo.set list with more than 550 elements will generate the error you mentioned. I have no idea whether this is a design decision, a bug, or some other issue.

When I had this problem I divided my geo.set into two geo.sets, each with less than 550 elements, fetched results for the two geographies, and then combined the output. Perhaps there is a more elegant workaround.

Kind Regards,
Carl Ganz
Assistant Statistician
UCLA Center for Health Policy Research

From: acs-r-bounces at mit.edu<mailto:acs-r-bounces at mit.edu> [mailto:acs-r-bounces at mit.edu] On Behalf Of Jonah Newman
Sent: Monday, April 18, 2016 2:30 PM
To: acs-r at mit.edu<mailto:acs-r at mit.edu>
Subject: [acs-r] Error message in acs 2.0

Hi everyone,

I’m new to this listserv, and pretty new to R. I’ve used the acs package once before, on a fairly small set of geographies, and it was great! Now I’m trying it on a larger set, and it’s having some trouble. For reference, I’m using R version 3.2.5, and R Studio version 0.98.1103.

My geo.set has 591 elements (census tracts). I used check=T to make sure they were all good, and they are.

But when I try to use acs.fetch to download data, I’m getting the following error:

Error in if (url.test["statusMessage"] != "OK") { :
  missing value where TRUE/FALSE needed

Here’s my code:

#select race by Hispanic Origin data from ACS for selected geographies
race <- acs.fetch(endyear=2014, span=5, geography = mygeo, table.number="B03002", dataset = "acs")

Can anyone help me figure out what’s happening, and why?

Thanks!
Jonah
---
​​Jonah Newman
​​Data & Investigative Reporter
​​The Chicago Reporter
​​(312) 673-3807 (office)
(312) 857-8675 (cell)
​​@jonahshai

​​The Chicago Reporter is a nonprofit investigative news organization that focuses on race, poverty and income inequality.



This e-mail message, including attachments, is for the sole use of the intended recipient(s) and may contain confidential or proprietary information.  If you are not the intended recipient, immediately contact the sender by reply e-mail and destroy all copies of the original message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/acs-r/attachments/20160419/24ae3c1b/attachment.html


More information about the acs-r mailing list