Skip to contents

Install a StreetLight API key in your .Renviron for repeated use

Usage

streetlight_api_key(key, overwrite = FALSE, install = FALSE)

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 .Renviron file.

install

logical, if TRUE, will install the key in your .Renviron file for use in future sessions. Default is FALSE.

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")
}