Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug report: getCensus not pulling > 2015 vintages for components. #55

Closed
CVIOG-Demography opened this issue Jun 19, 2019 · 4 comments
Closed

Comments

@CVIOG-Demography
Copy link

CVIOG-Demography commented Jun 19, 2019

Describe the bug
I call the getCensus function on pep/components but it only returns through period 8 (2015) although the data is available through 2017 at least.

To Reproduce
pep_com <- getCensus(name="pep/components", # This is the Estimates datafile
vintage = 2017, # Vintage year is set to the variable set above
vars = "PERIOD", # gathering these variables
region="COUNTY", # at the geography of COUNTY
regionin="state:13" # within the state of Georgia
)

table(pep_com$PERIOD)
1 2 3 4 5 6 7 8
159 159 159 159 159 159 159 159

Expected behavior
Should return period 1-10, which is 2017.

R session information:

  • censusapi package version: 0.6.0
  • R version: "R version 3.6.0 (2019-04-26)"

Additional context
I contacted the Census and they said that it must be a bug in the package.

@hrecht
Copy link
Owner

hrecht commented Jun 20, 2019

Hi, I'm not seeing a bug here. I get the same results with the raw API call:
https://api.census.gov/data/2017/pep/components?key=[KEY]&get=PERIOD&for=COUNTY&in=state%3A13
If data for 9 and 10 should be returned, it's not an issue from censusapi since it's returning the same thing as the underlying API. Adding PERIOD_DESC to the call, it says that period 8 is 2016 to 2017.

temp <- getCensus(name="pep/components",
vintage = 2017,
vars = c("PERIOD", "PERIOD_DESC"), 
region="COUNTY", 
regionin="state:13")

@hrecht
Copy link
Owner

hrecht commented Jun 20, 2019

Closing because this seems to be a misreading of the returned data, but I can reopen if I'm misunderstanding.

@hrecht hrecht closed this as completed Jun 20, 2019
@CVIOG-Demography
Copy link
Author

Thanks. I looked at the PERIOD codes and I did confuse PERIOD 8 with (year ending in) 2015, when it is (year ending in ) 2017. So that was part of it. However, I posted this same issue over at tidyverse and Kyle looked into it and reported "As a notable aside - by setting year to 2018 you can get the most recent data now as I just pushed a fix due to a change in the API." So I do think that there was a change in the CB API. Even after his fix, I still can't pull all years unless I do it individually, whereas before I could. So it might be worth taking a second look at the API. Thanks for clarifying for me.

@hrecht
Copy link
Owner

hrecht commented Jun 24, 2019

2018 has been available through this package since the Census Bureau made it available; tidycensus is a different package. I'm glad you were able to find a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants