Set your IPUMS API key as the value associated with the IPUMS_API_KEY
environment variable.
The key can be stored for the duration of your session or for future
sessions. If saved for future sessions, it is added to the .Renviron
file in your home directory. If you choose to save your key to .Renviron
,
this function will create a backup copy of the file before modifying.
This function is modeled after the census_api_key()
function
from tidycensus.
Learn more about the IPUMS API in vignette("ipums-api")
.
Arguments
- api_key
API key associated with your user account.
- save
If
TRUE
, save the key for use in future sessions by adding it to the.Renviron
file in your home directory. Defaults toFALSE
, unlessoverwrite = TRUE
.- overwrite
If
TRUE
, overwrite any existing value ofIPUMS_API_KEY
in the.Renviron
file with the providedapi_key
. Defaults toFALSE
.- unset
If
TRUE
, remove the existing value ofIPUMS_API_KEY
from the environment and the.Renviron
file in your home directory.
See also
set_ipums_default_collection()
to set a default collection.