[acs-r] Different data via API vs FactFinder?
Ezra Haber Glenn
eglenn at mit.edu
Tue Apr 17 07:56:01 EDT 2018
Thanks for your email, and for using the package. The issue you've
run into here is that even though you set the "span=1" when you saved
the variables, you didn't set it for acs.fetch, which means that
acs.fetch used span=5 as a default.
If you use this instead, I think you'll see the same numbers as
FactFinder:
###########
## set geography to city of Madison, Wisconsin
Madison <- geo.make(state="WI", place = 48000)
## select only the total, car/truck/van, public transport, bicycle,
walk variables from table B08006
TransitVars <- acs.lookup(2016, span = 1, table.number = "B08006",
dataset = "acs")[c(1,2,8,14,15)]
#fetch data for 2016 year and return them into acs object
###### ADD "span = 5" for acs.fetch()
ACSData2016 <- acs.fetch(2016, span = 5, geography = Madison,
variable = TransitVars,
col.names = c("Total", "Motor Vehicle", "Public
transit", "Bicycle", "Walked"))
##########
Best,
Ezra
On Sun, 15 Apr 2018 15:19:18 -0400, Harald Kliems wrote:
>
> For our bike advocacy organization, I have been looking into commuting
> data from the ACS. Until recently, I used the FactFinder to download
> tables and then manipulate and analyze the data in LibreOffice Calc.
> I've now tried using the very useful ACS.r package to improve my work
> flow, but looking at the retrieved data, there seem to be differences
> between what I get through the ACS.r/API and what I download through
> the web interface from FactFinder.
>
> For example, for 2016 ACS 1-year data from table B08006 for Madison (WI):
>
> ###########
> ## set geography to city of Madison, Wisconsin
> Madison <- geo.make(state="WI", place = 48000)
>
> ## select only the total, car/truck/van, public transport, bicycle,
> walk variables from table B08006
> TransitVars <- acs.lookup(2016, span = 1, table.number = "B08006",
> dataset = "acs")[c(1,2,8,14,15)]
>
> #fetch data for 2016 year and return them into acs object
>
> ACSData2016 <- acs.fetch(2016, geography = Madison,
> variable = TransitVars,
> col.names = c("Total", "Motor Vehicle", "Public
> transit", "Bicycle", "Walked"))
> ##########
>
> Just looking at the "total" column, I get 140,435 through ACS.r but
> 146715 when looking up the same table and geography through
> FactFinder. Similar differences exist for other years and the other
> variables.
>
> I'm pretty new to R, and so it's entirely possible that I'm doing
> something wrong, but I don't see an obvious explanation for the
> discrepancy.
>
> Any hints would be appreciated.
>
> Thanks,
> Harald.
> _______________________________________________
> 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