Set your IPUMS API key for the duration of your session, or indefinitely by adding it to the file ".Renviron" in your home directory. In either case, this function works by assigning your API key as the value of the environment variable IPUMS_API_KEY. 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 the R package tidycensus.

set_ipums_api_key(api_key, save = FALSE, overwrite = FALSE)

Arguments

api_key

API key associated with your user account, formatted in quotes.

save

Do you want to save this value for future sessions by adding it to the file ".Renviron" in your home directory? Defaults to FALSE.

overwrite

Do you want to overwrite any existing value of IPUMS_API_KEY in the file ".Renviron"? Defaults to FALSE.

Value

The value of api_key, invisibly.