Retrieve the keys for a certain basemap from the Datawrapper-API.

dw_get_map_key(api_key = "environment", basemap_id, basemap_value)

Arguments

api_key

Required. A Datawrapper-API-key as character string. Defaults to "environment" - tries to automatically retrieve the key that's stored in the .Reviron-file by datawrapper_auth.

basemap_id

Required. Can be retrieved by looking at dw_basemaps.

basemap_value

Required. Can be retrieved by looking at dw_basemaps.

Value

A S3-structure of type dw_basemap_keys with the elements from the Datawrapper-API, and the following fields:

content

A data.frame of the returned keys.

path

The url of the API call.

id

The basemap id provided.

value

The basemap value provided.

Note

This function returns a data.frame with the keys for the requested map. These keys can be used to map data to the basemap.

Author

Benedict Witzenberger

Examples

if (FALSE) { dw_get_map_key(basemap_id = "world2019", basemap_value = "DW_NAME") # uses the preset key in the .Renviron-file }