diff --git a/R/countries.R b/R/countries.R index d6e7f4b..c60b56c 100644 --- a/R/countries.R +++ b/R/countries.R @@ -106,6 +106,9 @@ list_countries <- function( rate_limit = rate_limit, api_key = api_key ) + if (isTRUE(dry_run)) { + return(data) + } if (as_data_frame == TRUE) { return(as.data.frame.openaq_countries_list(structure( data, diff --git a/R/latest.R b/R/latest.R index 225d7ab..7e9f11f 100644 --- a/R/latest.R +++ b/R/latest.R @@ -47,6 +47,9 @@ list_location_latest <- function( ) path <- paste("locations", locations_id, "latest", sep = "/") data <- fetch(path, params_list, dry_run = dry_run) + if (isTRUE(dry_run)) { + return(data) + } if (as_data_frame == TRUE) { invisible(as.data.frame.openaq_latest_list(structure( data, diff --git a/R/locations.R b/R/locations.R index 817bd63..2f8e176 100644 --- a/R/locations.R +++ b/R/locations.R @@ -30,6 +30,9 @@ get_location <- function( rate_limit = rate_limit, api_key = api_key ) + if (isTRUE(dry_run)) { + return(data) + } if (as_data_frame == TRUE) { return(as.data.frame.openaq_locations_list(structure( data, @@ -189,6 +192,9 @@ list_locations <- function( rate_limit = rate_limit, api_key = api_key ) + if (isTRUE(dry_run)) { + return(data) + } if (as_data_frame == TRUE) { return(as.data.frame.openaq_locations_list(structure( data, diff --git a/R/manufacturers.R b/R/manufacturers.R index acf0c70..0974712 100644 --- a/R/manufacturers.R +++ b/R/manufacturers.R @@ -30,6 +30,9 @@ get_manufacturer <- function( rate_limit = rate_limit, api_key = api_key ) + if (isTRUE(dry_run)) { + return(data) + } if (as_data_frame == TRUE) { return(as.data.frame.openaq_manufacturers_list(structure( data, @@ -95,6 +98,9 @@ list_manufacturers <- function( rate_limit = rate_limit, api_key = api_key ) + if (isTRUE(dry_run)) { + return(data) + } if (as_data_frame == TRUE) { return(as.data.frame.openaq_manufacturers_list(structure( data, diff --git a/R/measurements.R b/R/measurements.R index de2f252..9f02982 100644 --- a/R/measurements.R +++ b/R/measurements.R @@ -78,6 +78,9 @@ list_sensor_measurements <- function( rate_limit = rate_limit, api_key = api_key ) + if (isTRUE(dry_run)) { + return(data) + } if (as_data_frame == TRUE) { return(as.data.frame.openaq_measurements_list(structure( data, diff --git a/R/owners.R b/R/owners.R index c81be4e..3bb03f7 100644 --- a/R/owners.R +++ b/R/owners.R @@ -30,6 +30,9 @@ get_owner <- function( rate_limit = rate_limit, api_key = api_key ) + if (isTRUE(dry_run)) { + return(data) + } if (as_data_frame == TRUE) { return(as.data.frame.openaq_owners_list(structure( data, @@ -96,6 +99,9 @@ list_owners <- function( rate_limit = rate_limit, api_key = api_key ) + if (isTRUE(dry_run)) { + return(data) + } if (as_data_frame == TRUE) { return(as.data.frame.openaq_owners_list(structure( data, diff --git a/R/parameters.R b/R/parameters.R index 9c68660..47e2cd3 100644 --- a/R/parameters.R +++ b/R/parameters.R @@ -30,6 +30,9 @@ get_parameter <- function( rate_limit = rate_limit, api_key = api_key ) + if (isTRUE(dry_run)) { + return(data) + } if (as_data_frame == TRUE) { return(as.data.frame.openaq_parameters_list(structure( data, @@ -95,6 +98,9 @@ list_parameters <- function( rate_limit = rate_limit, api_key = api_key ) + if (isTRUE(dry_run)) { + return(data) + } if (as_data_frame == TRUE) { return(as.data.frame.openaq_parameters_list(structure( data, diff --git a/R/providers.R b/R/providers.R index 03800b9..6b34717 100644 --- a/R/providers.R +++ b/R/providers.R @@ -30,6 +30,9 @@ get_provider <- function( rate_limit = rate_limit, api_key = api_key ) + if (isTRUE(dry_run)) { + return(data) + } if (as_data_frame == TRUE) { return(as.data.frame.openaq_providers_list(structure( data, @@ -95,6 +98,9 @@ list_providers <- function( rate_limit = rate_limit, api_key = api_key ) + if (isTRUE(dry_run)) { + return(data) + } if (as_data_frame == TRUE) { return(as.data.frame.openaq_providers_list(structure( data, diff --git a/R/sensors.R b/R/sensors.R index 96dbcde..def1861 100644 --- a/R/sensors.R +++ b/R/sensors.R @@ -30,6 +30,9 @@ get_sensor <- function( rate_limit = rate_limit, api_key = api_key ) + if (isTRUE(dry_run)) { + return(data) + } if (as_data_frame == TRUE) { return(as.data.frame.openaq_sensors_list(structure( data, @@ -75,6 +78,9 @@ get_location_sensors <- function( rate_limit = rate_limit, api_key = api_key ) + if (isTRUE(dry_run)) { + return(data) + } if (as_data_frame == TRUE) { return(as.data.frame.openaq_sensors_list(structure( data,