heli-xu / findSVI

Calculate CDC/ATSDR Social Vulnerability Index
https://heli-xu.github.io/findSVI/
Other
2 stars 3 forks source link

Bug when using ZCTA 2022 data from developer version #24

Open usamabilal opened 1 week ago

usamabilal commented 1 week ago
#install.packages(c("tidyverse", "devtools))
# devtools::install_github("heli-xu/findSVI")
library(tidyverse)
library(findSVI)
find_svi(year=2022, state="PA", geography="zcta")

And the output is:

ℹ State-specific ZCTA-level data for 2022 is currently not supported by Census API. Getting nation-based data and selecting ZCTAs in PA...(it might take a bit longer) Getting data from the 2018-2022 5-year ACS Fetching data by table type ("B/C", "S", "DP") and combining the result. Error in get(xwalk_name) : object 'zcta_state_xwalk2022' not found

heli-xu commented 1 week ago

Thanks for catching this! I had a feeling I missed something with 2022...My bad! I forgot to update the zcta xwalk. I will add that later today.

heli-xu commented 1 week ago

It should work now. Thanks!

A side note about 2022 ZCTA spatial data: As of now, get_census_data() with geometry = TRUE will cause an error "The Census Bureau has not yet released the CB ZCTA file for 2022. " This is because tidycensus::get_acs() uses cb = TRUE as default for geometry = TRUE calls, but the cartographic boundary files are not available for 2022. To fix the error, add an additional cb = FALSE argument in the get_census_data().

usamabilal commented 1 week ago

thank you!