dw_retrieve_chart_metadata: Retrieves a Datawrapper chart's metadata

View source: R/dw_retrieve_chart_metadata.R

dw_retrieve_chart_metadataR Documentation

Retrieves a Datawrapper chart's metadata

Description

Return the metadata of a existing Datawrapper chart.

Usage

dw_retrieve_chart_metadata(chart_id, api_key = "environment")

Arguments

chart_id

Required. A Datawrapper-chart-id as character string, usually a five character combination of digits and letters, e.g. "aBcDe". Or a dw_chart-object.

api_key

Optional. 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.

Value

A S3-structure of type dw_chart with the elements from the Datawrapper-API stored under content. Same as in dw_create_chart.

status

Returns 'ok' if the API-key used was correct.

$data$id

Returns the internal id of the chart - the same as used in chart_id.

$data$title

Returns the chart's title.

$data$theme

Returns the chart's theme.

$data$createdAt

Chart's creation date.

$data$lastModifiedAt

Chart's last modification date.

$data$metadata

Contains chart's specifications, like transpose, column formats, visualization settings, colors, titles and texts

$data$metadata$visualize

Contains the chart's visualization settings.

$data$metadata$describe

Contains the chart's description settings, like title, source name and url, byline

$data$publishedAt

Chart's publication date - if published yet.

$data$author$id

The chart-author's id.

Note

This function retrieves all metadata about a chart that's stored by Datawrapper. It is helpful to gain insights in the different options that might be changed via the API.

Author(s)

Benedict Witzenberger

Examples


## Not run: 
dw_retrieve_chart_metadata("aBcDE")

## End(Not run) # uses the preset key in the .Renviron-file

## Not run: dw_retrieve_chart_metadata(chart_id = "a1B2Cd", api_key = "1234ABCD") # uses the specified key


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