You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to get ACS county-to-county migration flow data using censusapi following your example here
I have successfully downloaded ACS migration flow data for 2016 using the following code:
vars <-c("MOVEDIN", "MOVEDOUT", "FULL1_NAME", "FULL2_NAME", "GEOID2") migr16 <- getCensus(name = "acs/flows", vintage = 2016, vars = vars, region = "county“)
However, this does not work for other years than 2016. For 2015 it only works if I add "regionin" for one state:
migr15 <- getCensus(name = "acs/flows", vintage = 2015, vars = vars, region = "county", regionin = "state:01“)
As I want to download data for all counties I tried looping it using map_dfr as suggested here:
mystates <- c(paste0("state:", str_pad(1:51, 2, pad="0"))) migr15 <- map_dfr(mystates, ~ getCensus(name = "acs/flows", vintage = 2015, vars = vars, region = "county", regionin = .x) )
I also tried other options as suggested in the post. None of them worked when using censusapi. I would highly appreciate your help!
Censusapi package version: 0.6.0
R version: 3.5.1
The text was updated successfully, but these errors were encountered:
mali543
changed the title
Bug report:
Bug report: error getting ACS county-to-county migration flow data for all states
Apr 19, 2019
The 2015 county data is not available for all states at once - the county geography is nested within state for that year, which can be seen with listCensusMetadata(name = "acs/flows", vintage = 2015, type = "geographies") (or https://api.census.gov/data/2015/acs/flows/geography.html)
I am trying to get ACS county-to-county migration flow data using censusapi following your example here
I have successfully downloaded ACS migration flow data for 2016 using the following code:
vars <-c("MOVEDIN", "MOVEDOUT", "FULL1_NAME", "FULL2_NAME", "GEOID2") migr16 <- getCensus(name = "acs/flows", vintage = 2016, vars = vars, region = "county“)
However, this does not work for other years than 2016. For 2015 it only works if I add "regionin" for one state:
migr15 <- getCensus(name = "acs/flows", vintage = 2015, vars = vars, region = "county", regionin = "state:01“)
As I want to download data for all counties I tried looping it using map_dfr as suggested here:
mystates <- c(paste0("state:", str_pad(1:51, 2, pad="0"))) migr15 <- map_dfr(mystates, ~ getCensus(name = "acs/flows", vintage = 2015, vars = vars, region = "county", regionin = .x) )
I also tried other options as suggested in the post. None of them worked when using censusapi. I would highly appreciate your help!
Censusapi package version: 0.6.0
R version: 3.5.1
The text was updated successfully, but these errors were encountered: