Install a StreetLight API key in your .Renviron for repeated use
Source: R/streetlight_api_key.R
streetlight_api_key.RdInstall a StreetLight API key in your .Renviron for repeated use
Arguments
- key
The API key provided to you from StreetLight formated in quotes.
- overwrite
logical, If this is set to TRUE, it will overwrite an existing STREETLIGHT_API_KEY that you already have in your
.Renvironfile.- install
logical, if
TRUE, will install the key in your.Renvironfile for use in future sessions. Default isFALSE.
Note
Adapted from tidycensus::census_key
Examples
if (FALSE) {
streetlight_key("111111abc", install = TRUE)
# First time, reload your environment so you can use the key without restarting R.
readRenviron("~/.Renviron")
# You can check it with:
Sys.getenv("STREETLIGHT_API_KEY")
}
if (FALSE) {
# If you need to overwrite an existing key:
streetlight_key("111111abc", overwrite = TRUE, install = TRUE)
# First time, reload your environment so you can use the key without restarting R.
readRenviron("~/.Renviron")
# You can check it with:
Sys.getenv("STREETLIGHT_API_KEY")
}