View source: R/api_process_extract.R
download_supplemental_data | R Documentation |
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.
download_supplemental_data(
collection,
path,
download_dir = getwd(),
overwrite = FALSE,
progress = TRUE,
api_key = Sys.getenv("IPUMS_API_KEY")
)
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 |
The path to the downloaded supplemental data file
## 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_nhgis(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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.