download_supplemental_data {ipumsr} | R Documentation |
Download IPUMS supplemental data files
Description
Some IPUMS collections provide supplemental data files that are available outside of the IPUMS extract system. Use this function to download these files.
Currently, only IPUMS NHGIS files are supported.
In general, files found on an IPUMS project website that include
secure-assets
in their URL are available as supplemental data. See the
IPUMS developer documentation
for more information on available endpoints.
Usage
download_supplemental_data(
collection,
path,
download_dir = getwd(),
overwrite = FALSE,
progress = TRUE,
api_key = Sys.getenv("IPUMS_API_KEY")
)
Arguments
collection |
Code for the IPUMS collection represented by this
extract request. Currently, only |
path |
Path to the supplemental data file to download. See examples. |
download_dir |
Path to the directory where the files should be written. Defaults to current working directory. |
overwrite |
If |
progress |
If |
api_key |
API key associated with your user account. Defaults to the
value of the |
Value
The path to the downloaded supplemental data file
Examples
## Not run:
# Download a state-level tract to county crosswalk from NHGIS
file <- download_supplemental_data(
"nhgis",
"crosswalks/nhgis_tr1990_co2010_state/nhgis_tr1990_co2010_10.zip"
)
read_ipums_agg(file)
# Download 1980 Minnesota block boundary file
file <- download_supplemental_data(
"nhgis",
"blocks-1980/MN_block_1980.zip"
)
read_ipums_sf(file)
## End(Not run)