dw_get_map_key: Returns the Datawrapper-Map-keys

View source: R/dw_get_map_key.R

dw_get_map_keyR Documentation

Returns the Datawrapper-Map-keys

Description

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

Usage

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(s)

Benedict Witzenberger

Examples


## Not run: 

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


## End(Not run)


munichrocker/DatawRappr documentation built on March 20, 2024, 6:08 a.m.