Initialize the API key citymappR will send in every request for authentication. If a file is found at the location specified in config_file, the values will be used.

citymappr_setup(config_file = ".citymappr", api_token = NULL, echo = FALSE)

Arguments

config_file

a configuration file in DCF format. See read.dcf. By default the key will be searched in the current working directory.

api_token

Citymapper's api key (chr).

echo

display the api_token (bool), initally set as FALSE

Value

An env variable

Details


api_token: YOUR_TOKEN_STRING

Examples

if (FALSE) {
# Reads from default file (i.e ~/.citymappr)
citymmappr_setup()

# Reads from alternate config file
citymappr_setup("~/path/to/config")

# The manual way
citymappr_setup(api_token = "your_api_string")
}