Skip to contents

Download or read cached tract-to-PUMA crosswalk file from Census or package backup. Use to support construction of tract-PUMA mapping for ACS/PUMS integration.

Usage

load_xwalk(settings, target_url, sep = ",", verbose = TRUE)

Arguments

settings

list. Must include:

  • inputs_dir — directory for cached crosswalks Modified by reference: no.

target_url

character(1). URL of crosswalk file.

sep

character(1). Separator for file. Default: ','.

verbose

logical. Print messages. Default: TRUE.

Value

data.table. All columns from Census crosswalk file.

Details

  • Downloads crosswalk file from Census if not cached locally.

  • Caches file in settings$inputs_dir/xwalks.

  • Falls back to package backup if download fails.

  • Returns a data.table with all columns from Census file; does not modify by reference.

  • Errors if file cannot be read or written.

Settings

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

Examples

## Not run:
load_xwalk(settings, target_url)
#> Error in load_xwalk(settings, target_url): could not find function "load_xwalk"
## End(Not run)