[acs-r] Trick to get 2016 data failing for C16001

Ezra Haber Glenn eglenn at mit.edu
Mon Apr 9 09:32:56 EDT 2018


You can still get this data via the package, but it's definitely a
little "off road."  From what I can tell, there are 38 variables in
C16001.  Since acs.fetch allows you to specify the variable codes
directly -- and thus avoids a lookup -- you can just tell it the names
of the variables, which will be C16001_001, C16001_002, C16001_002,
etc., up to C16001_038.

> library(acs)
> my.geo=geo.make(state="MA", county="*")

# get leading zero for single digits
> my.nums=c(paste("0",1:9, sep=""), 10:38) 

# construct all 38 codes
> my.vars.2016=paste("C16001_0", my.nums, sep="")

And then use these variable codes directly in acs.fetch:

> acs.fetch(geography=my.geo, variable=my.vars.2016, endyear=2016)

That seems to work for me.  You'll need to be responsible for
checking, and for making sure you label the variable columns
correctly.

Let me know if that works.

Best,
Ezra


On Sun, 08 Apr 2018 12:40:20 -0400, Jon Zadra wrote:
> 
> [1  <multipart/alternative (7bit)>]
> [1.1  <text/plain; UTF-8 (quoted-printable)>]
> [1.2  <text/html; UTF-8 (quoted-printable)>]
> HI,
> 
> I’ve been using the lookup 2015 then fetch 2016 trick without issue for many tables,
> however today I ran into an issue with table C16001 where it can’t find it in the 2016
> lookup:
> 
> a <- acs.lookup(table.number = "C16001", endyear = 2015, span = 5) 
> Warning message: In acs.lookup(table.number = "C16001", endyear = 2015, span = 5) : Sorry,
> no tables/keyword meets your search. Suggestions: try with 'case.sensitive=F', remove
> search terms, change 'keyword' to 'table.name' in search (or vice-versa
> 
> I’m not sure if this is because they didn’t have C16001 in 2015 and it’s a new addition
> for 2016, or whether they don’t have the C version via the API (the B version exists).
> 
> I really need the C version, as the B version has a lot of suppression due to about 20
> more categories.  Any help is appreciated!
> 
> Thanks,
> 
> Jon
> 
> --
> Jonathan Zadra, PhD
> Data Scientist
> Sorenson Impact Center
> David Eccles School of Business, University of Utah
> (801) 581-4815
> jon.zadra at sorensonimpact.com
> www.sorensonimpact.com
> 
> [email_]
> 
> 
> [2  <text/plain; us-ascii (7bit)>]
> _______________________________________________
> acs-r mailing list
> acs-r at mit.edu
> http://mailman.mit.edu/mailman/listinfo/acs-r

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



More information about the acs-r mailing list