zipcodeR icon indicating copy to clipboard operation
zipcodeR copied to clipboard

Update zip code/congressional district relationships (fixes #29)

Open awallender opened this issue 1 year ago • 0 comments

Updated congressional districts using the Census' "National 2020 118th Congressional District to 2020 Zip Code Tabulation Area (ZCTA) Relationship File" (https://www2.census.gov/geo/docs/maps-data/data/rel2020/cd-sld/tab20_cd11820_zcta520_natl.txt) accessed on Sept. 19, 2023.

I obtained the updated listing using the following code to convert the downloaded relationship file to have the same structure as the existing zip_to_cd.rda file:

library(tidyverse)

zip_to_cd <- read_delim("./tab20_cd11820_zcta520_natl.txt") %>% 
  select(GEOID_ZCTA5_20, GEOID_CD118_20) %>% 
  rename(ZIP = GEOID_ZCTA5_20, CD = GEOID_CD118_20) %>% 
  filter(!is.na(ZIP))

This update fixes Issue #29 by utilizing updated congressional district mappings.

awallender avatar Sep 19 '23 17:09 awallender