knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
This package includes a ZIP Code to ZCTA crosswalk table developed by John Snow, Inc. The data is downloaded from UDS Mapper, and it should be able to link ZIP codes to 2010 Census ZCTAs.
# install.packages("devtools") devtools::install_github("jjchern/zipzcta")
# devtools::install_github("jjchern/zipzcta") # devtools::install_github("jjchern/zcta") library(dplyr) # ZIP codes to ZCTAs zipzcta::zipzcta # ZCTAs to Counties zctacounty = zcta::zcta_county_rel_10 %>% select(zcta5, state, county, geoid, poppt, zpoppct) %>% group_by(zcta5) %>% slice(which.max(zpoppct)) %>% left_join(gaze::county10, by = "geoid") %>% select(zcta5, state, usps, county, geoid, name) zctacounty # ZIP codes to ZCTAs to Counties zipcounty = zipzcta::zipzcta %>% left_join(zctacounty, by = c("zcta" = "zcta5")) %>% select(zip, zcta, state = usps, countygeoid = geoid, countyname = name) %>% arrange(zip) zipcounty
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.