Skip to contents

Download and construct a crosswalk between census tracts and PUMAs for specified years. Use to map ACS or PUMS data between tract and PUMA geographies in weighting pipelines.

Usage

get_tracts_puma_xwalk(settings, puma_year = NULL, tract_year = NULL)

Arguments

settings

list. Must include:

  • inputs_dir — directory for cached crosswalks

  • state_fips — state FIPS code

  • pums_year — PUMS year

  • pumas — valid PUMA codes Modified by reference: no.

puma_year

integer. PUMS year. Default: settings$pums_year.

tract_year

integer. ACS/reference year. Default: puma_year.

Value

data.table with columns:

  • STATEFP — state FIPS

  • COUNTYFP — county FIPS

  • TRACTCE — tract code

  • PUMA — PUMA code

  • tract_id — tract identifier Rows: one per tract.

Details

  • Downloads crosswalk files from Census for 2010 and 2020 vintages.

  • Handles mismatched tract/PUMA years by joining and constructing custom crosswalks.

  • Uses settings for state FIPS, input directories, and year selection.

  • Caches downloaded files locally; falls back to package backup if download fails.

  • Returns a data.table with tract, PUMA, and related columns; does not modify by reference.

  • Errors if required settings or geographies are missing.

Settings

  • inputs_dir (direct): directory for cached crosswalks. Default from settings.

  • state_fips (direct): state FIPS code. Default from settings.

  • pums_year (direct): PUMS year. Default from settings.

  • pumas (direct): valid PUMA codes. Default from settings.

See also

  • load_xwalk

  • scripts/weighting/get_tracts_puma_xwalk.R

Other ACS utilities: get_acs_bg_counts(), get_acs_bg_counts_base(), get_overlap_allocation(), get_puma_ids(), get_pumas(), get_xwalk_sfx_to_sfy(), load_xwalk()

Examples

## Not run:
get_tracts_puma_xwalk(settings, puma_year = 2021, tract_year = 2020)
#> Creating custom PUMA-Tract crosswalk for 2021 PUMS and 2020 ACS.
#> Error: object 'settings' not found
## End(Not run)