setTargomoVariables: Set Targomo Environment Variables

Description Usage Arguments Details Value Examples

View source: R/setup.R

Description

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.

Usage

1
2
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")

Details

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

Value

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

Examples

1
2
3
4
5
## Not run: 
# write to a global file at Sys.getenv("HOME")
setTargomoVariables(api_key = "YOUR_SECRET_KEY", region = "asia", overwrite = TRUE, global = TRUE)

## End(Not run)

TargomoR documentation built on Dec. 7, 2019, 1:07 a.m.