#' Set API Key
#'
#' Helper function to set the mapbox API key as an environment variable
#'
#' @param key a mapbox API key
#'
#' @examples
#' \dontrun{
#' set_mapbox_api('<api key here>')
#' # Check our assignment worked
#' Sys.getenv('mapbox_api_key')
#'
#' #[1] "<api key here>"
#' }
#' @export
set_mapbox_api <- function(key){
Sys.setenv(mapbox_api_key = key)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.