zi_load_crosswalk {zippeR} | R Documentation |
Load Crosswalk Files
Description
Spatial data on USPS ZIP Codes are not published by the U.S. Postal Service or the U.S. Census Bureau. Instead, ZIP Codes can be converted to a variety of Census Bureau geographies using crosswalk files. This function reads in ZIP Code to ZIP Code Tabulation Area (ZCTA) crosswalk files from the former UDS Mapper project, which was sunset by the American Academy of Family Physicians in early 2024. It also provides access to the U.S. Department of Housing and Urban Development's ZIP Code crosswalk files, which provide similar functionality for converting ZIP Codes to a variety of geographies including counties.
Usage
zi_load_crosswalk(zip_source = "UDS", year, qtr = NULL, target = NULL,
query = NULL, key = NULL)
Arguments
zip_source |
Required character scalar; specifies the source of ZIP Code
crosswalk data. This can be one of either |
year |
Required four-digit numeric scalar for year; varies based on source.
For |
qtr |
Numeric scalar, required when |
target |
Character scalar, required when |
query |
Scalar or vector, required when |
key |
Optional when |
Value
A tibble containing the crosswalk file.
Examples
# former UDS mapper crosswalks
zi_load_crosswalk(zip_source = "UDS", year = 2020)
# HUD crosswalks
## ZIP Code to CBSA crosswalk for all ZIP Codes
zi_load_crosswalk(zip_source = "HUD", year = 2023, qtr = 1, target = "CBSA",
query = "all")
## ZIP Code to County crosswalk for all ZIP Codes in Missouri
zi_load_crosswalk(zip_source = "HUD", year = 2023, qtr = 1, target = "COUNTY",
query = "MO")
## ZIP Code to Tract crosswalk for ZIP Code 63139 in St. Louis City
zi_load_crosswalk(zip_source = "HUD", year = 2023, qtr = 1, target = "TRACT",
query = 63139)