get_api_key {ceramic}R Documentation

Get API key for Mapbox service

Description

Mapbox tile providers require an API key. Other providers may not need a key and so this is ignored.

Usage

get_api_key(api = "mapbox", ..., silent = FALSE)

Arguments

api

character string denoting which service ("mapbox" only)

...

currently ignored

silent

run in completely silent mode, default is to provide a warning

Details

The mapdeck package has a more comprehensive tool for setting the Mapbox API key, if this is in use ceramic will find it first and use it.

To set your Mapbox API key obtain a key from https://account.mapbox.com/access-tokens/

1) Run this to set for the session 'Sys.setenv(MAPBOX_API_KEY=<yourkey>)'

OR,

2) To set permanently store 'MAPBOX_API_KEY=<yourkey>' in '~/.Renviron'.

There is a fairly liberal allowance for the actual name of the environment variable, any of 'MAPBOX_API_KEY', 'MAPBOX_API_TOKEN', 'MAPBOX_KEY', 'MAPBOX_TOKEN', or 'MAPBOX' will work (and they are sought in that order).

If no key is available, NULL is returned, with a warning.

Value

The stored API key value, see Details.

Examples

get_api_key()

[Package ceramic version 0.9.5 Index]