dw_data_from_chart: Download the data in a Datawrapper chart

View source: R/dw_data_from_chart.R

dw_data_from_chartR Documentation

Download the data in a Datawrapper chart

Description

\lifecycle

maturing Downloads the data from an existing Datawrapper chart, that ypu have access to. This is the mirrored function to dw_data_to_chart.

Usage

dw_data_from_chart(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. You need to have access to the chart (e.g. it was created by yourself or in one of your teams).

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 data.frame.

Note

This function downloads a R-dataframe from a Datawrapper chart.

Author(s)

Benedict Witzenberger

Examples


## Not run: dw_data_from_chart(df, "aBcDE") # uses the preset key in the .Renviron-file

## Not run: df <- dw_data_from_chart(df, chart_id = "a1B2Cd", api_key = "1234ABCD") # uses the specified key


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