This helper function allows you to set your API key in either a global or local .Renviron file, for ease of use. All of the TargomoR functions which call the Targomo API require an API key, and use the TARGOMO_API_KEY environment variable by default. Similarly you can set your default region.

setTargomoVariables(
  api_key = NULL,
  region = NULL,
  overwrite = FALSE,
  global = FALSE
)

Arguments

api_key

Your Targomo API key

region

Your preferred Targomo default region

overwrite

Whether to overwrite an existing setting

global

If TRUE, write to a global .Renviron in Sys.getenv("HOME")

Value

Invisibly, the API key - this function is called for its side effects

Details

For available regions, see here: https://targomo.com/developers/resources/availability/

Examples

if (FALSE) { # write to a global file at Sys.getenv("HOME") setTargomoVariables(api_key = "YOUR_SECRET_KEY", region = "asia", overwrite = TRUE, global = TRUE) }