walkerke/tidycensus

get_acs for 2022 at the congressional district tries to use wrong layer

jtrosalez opened this issue · 2 comments

This statement is bring up an error.

CensusCongress22 <- get_acs (geography = "congressional district", variables = "B01001_001", state = "CA", geometry = TRUE, year=2022, survey="acs1")

I get the following error message:
Cannot open layer cb_2022_us_cd116_500k

It looks like it is try to open the layer as the 116th Congressional District, but the layer for this statement should be for the 118th Congressional District. Not sure if this is a problem with tidycensus or with the Census API?

Can you include your session info? I'm running tidycensus version 1.6.3 on R version 4.4.0 and when I run your sample code, I get back the expected output (118th Congressional Districts for California) with no errors.

@jtrosalez you likely have an old version of the tigris package installed which was released prior to the 118th Congress shapefiles. I got your error on one of my machines that had the old version installed; I updated with install.packages("tigris") to v2.1 and the code now runs.