Maturing lifecycle Creates a new Datawrapper chart object from an existing chart. This function starts the chart-making process like dw_create_chart.

dw_copy_chart(copy_from, api_key = "environment")

Arguments

copy_from

Required. Chart_id from an existing chart which serves as the template.

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.

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 and dw_create_chart.

Examples

if (FALSE) { dw_copy_chart(copy_from = "ABCDE") # uses api-key from environment - if set. } if (FALSE) { dw_copy_chart(copy_from = "ABCDE", api_key = "1234ABCD") } # uses the specified key