[Experimental] Creates and returns a new Datawrapper Symbol map object. This function starts the map-making process

dw_create_symbol_map(
  basemap_id,
  lat_col,
  lon_col,
  color_col = "",
  size_col = "",
  shape = "",
  api_key = "environment",
  title = "",
  tooltip = list(title, body, fields = c()),
  folderId = ""
)

Arguments

basemap_id

Required. Can be retrieved by looking at dw_basemaps.

lat_col

Required. Which column contains the Latitude values to be plotted on the map?

lon_col

Required. Which column contains the Latitude values to be plotted on the map?

color_col

Optional. Which column contains the values that should determine the color.

size_col

Optional. Which column contains the values that should determine the size.

shape

Optional. Select a shape. Defaults to circle.

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.

title

Optional. Will set a map's title on creation.

tooltip

Optional. Specify a list including these vectors: title, body, fields. Include all used variables in fields. Use " variable name " as placeholders in title and body.

folderId

Optional. Creates chart in specified folder.

Value

It prints the new chart's id and returns a S3-structure of type dw_chart with the elements from the Datawrapper-API, the same as in dw_retrieve_chart_metadata. After creating the chart you can populate and update it with dw_data_to_metadata

Note

If not specified, the new chart will by default be created without a title.

Author

Benedict Witzenberger

Examples

## Simple example: if (FALSE) { dw_create_symbol_map( basemap_id = "world-2019", basemap_value = "DW_STATE_CODE", lat_col = "LAT", lon_col = "LONG" ) ## Include a tooltip: dw_create_choropleth_map( basemap_id = "world-2019", basemap_value = "DW_STATE_CODE", value_cols = "percentage", key_cols = "iso_codes", tooltip = list( title = "{{ State_Name }}", body = "In {{ State_Name }} the value is {{percentage}} percent.", fields = c("State_Name", "percentage") )) }