diff --git a/R/dw_create_folder.R b/R/dw_create_folder.R index cc4c09a..fc408ff 100644 --- a/R/dw_create_folder.R +++ b/R/dw_create_folder.R @@ -45,7 +45,7 @@ dw_create_folder <- function(name = "", organization_id = "", parent_id = "", ap cat(paste0("New Folder '", parsed$name, "' successfully created!", "\n", "Folder-ID is: ", parsed$id, "\n")) } else { - warning(paste0("There has been an error in the folder creation process. Statuscode of the response: ", httr::status_code(r)), immediate. = TRUE) + stop(paste0("There has been an error in the folder creation process. Statuscode of the response: ", httr::status_code(r)), immediate. = TRUE) } return(parsed) diff --git a/R/dw_data_to_chart.R b/R/dw_data_to_chart.R index 1cd457b..11a1cd0 100644 --- a/R/dw_data_to_chart.R +++ b/R/dw_data_to_chart.R @@ -61,7 +61,7 @@ dw_data_to_chart <- function(x, chart_id, parse_dates = TRUE, api_key = "environ if (httr::status_code(r) %in% c(200, 201, 202, 204)) { cat(paste0("Data in ", chart_id, " successfully updated.", "\n")) } else { - warning(paste0("There has been an error in the upload process. Statuscode of the response: ", httr::status_code(r)), immediate. = TRUE) + stop(paste0("There has been an error in the upload process. Statuscode of the response: ", httr::status_code(r)), immediate. = TRUE) } } diff --git a/R/dw_delete_chart.R b/R/dw_delete_chart.R index 3e17081..eaea5e4 100644 --- a/R/dw_delete_chart.R +++ b/R/dw_delete_chart.R @@ -31,7 +31,7 @@ dw_delete_chart <- function(chart_id, api_key = "environment") { if (httr::status_code(r) == "204") { cat(paste0("Chart ", chart_id, " sucessfully deleted!", "\n")) } else { - warning("There has been an error while deleting the chart!", immediate. = TRUE) + stop("There has been an error while deleting the chart!", immediate. = TRUE) return(r) } diff --git a/R/dw_edit_chart.R b/R/dw_edit_chart.R index 010cc36..9491271 100644 --- a/R/dw_edit_chart.R +++ b/R/dw_edit_chart.R @@ -235,7 +235,7 @@ dw_edit_chart <- function(chart_id, api_key = "environment", title = "", intro = cat(paste0("Chart ", chart_id_response, " succesfully updated.", "\n")) } else { - warning(paste0("There has been an error in the upload process. Statuscode of the response: ", httr::status_code(r)), immediate. = TRUE) + stop(paste0("There has been an error in the upload process. Statuscode of the response: ", httr::status_code(r)), immediate. = TRUE) } httr::handle_reset(url_upload) diff --git a/R/dw_invite_user.R b/R/dw_invite_user.R index 5fb5e04..ebb603e 100644 --- a/R/dw_invite_user.R +++ b/R/dw_invite_user.R @@ -16,8 +16,7 @@ #' #' \dontrun{ #' dw_invite_user(team = "testTeam", email = "test_at_test.com", role = "admin") -#' # uses the preset key in the .Renviron-file -#' } +#' # uses the preset key in the .Renviron-file} #' #' @rdname dw_invite_user #' @export diff --git a/R/dw_publish_chart.R b/R/dw_publish_chart.R index 8187d6d..715a1fc 100644 --- a/R/dw_publish_chart.R +++ b/R/dw_publish_chart.R @@ -77,7 +77,7 @@ dw_publish_chart <- function(chart_id, api_key = "environment", return_urls = TR } } else { - warning(paste0("There has been an error in the publication process. Statuscode of the response: ", httr::status_code(r)), immediate. = TRUE) + stop(paste0("There has been an error in the publication process. Statuscode of the response: ", httr::status_code(r)), immediate. = TRUE) } } diff --git a/README.md b/README.md index 398f5f4..bce32f2 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ All functions (except `datawrapper_auth()`) are preceded by `dw_`: * lists all created charts: `dw_list_charts()`. * lists all folders: `dw_list_folders()`. * creates a new Datawrapper chart via `dw_create_chart()` +* copy a existing chart with: `dw_copy_chart()` * adds data from a R-dataframe to an existing Datawrapper chart via `dw_data_to_chart()` * retrieves (`dw_retrieve_chart_metadata()`) or edits metadata, description and visualization of an existing chart via `dw_edit_chart()` * publishes and republishes a Datawrapper chart via `dw_publish_chart()` diff --git a/Readme.Rmd b/Readme.Rmd index eb3422b..983650f 100644 --- a/Readme.Rmd +++ b/Readme.Rmd @@ -26,6 +26,7 @@ All functions (except `datawrapper_auth()`) are preceded by `dw_`: * lists all created charts: `dw_list_charts()`. * lists all folders: `dw_list_folders()`. * creates a new Datawrapper chart via `dw_create_chart()` +* copy a existing chart with: `dw_copy_chart()` * adds data from a R-dataframe to an existing Datawrapper chart via `dw_data_to_chart()` * retrieves (`dw_retrieve_chart_metadata()`) or edits metadata, description and visualization of an existing chart via `dw_edit_chart()` * publishes and republishes a Datawrapper chart via `dw_publish_chart()` diff --git a/data/dw_basemaps.rda b/data/dw_basemaps.rda index 647f5b0..d26745d 100644 Binary files a/data/dw_basemaps.rda and b/data/dw_basemaps.rda differ diff --git a/docs/articles/map.html b/docs/articles/map.html index aabe44e..a3fc25a 100644 --- a/docs/articles/map.html +++ b/docs/articles/map.html @@ -126,7 +126,7 @@