diff --git a/R/geo.R b/R/geo.R index 841ebe55..d4c2a568 100644 --- a/R/geo.R +++ b/R/geo.R @@ -145,18 +145,45 @@ progress_geo <- function(pb = NULL, ...) { #' } #' @seealso [geocode] [api_parameter_reference] [min_time_reference] [batch_limit_reference] #' @export -geo <- function(address = NULL, - street = NULL, city = NULL, county = NULL, state = NULL, postalcode = NULL, country = NULL, - method = 'osm', cascade_order = c('census', 'osm'), lat = 'lat', long = 'long', limit = 1, - full_results = FALSE, mode = '', unique_only = FALSE, return_addresses = TRUE, - min_time = NULL, progress_bar = show_progress_bar(), quiet = getOption("tidygeocoder.quiet", FALSE), - api_url = NULL, timeout = 20, flatten = TRUE, batch_limit = NULL, batch_limit_error = TRUE, - verbose = getOption("tidygeocoder.verbose", FALSE), no_query = FALSE, - custom_query = list(), api_options = list(), - return_type = 'locations', iq_region = 'us', geocodio_v = 1.6, - param_error = TRUE, mapbox_permanent = FALSE, here_request_id = NULL, - mapquest_open = FALSE) { - +geo <- + function( + address = NULL, + street = NULL, + city = NULL, + county = NULL, + state = NULL, + postalcode = NULL, + country = NULL, + method = 'osm', + cascade_order = c('census', 'osm'), + lat = 'lat', + long = 'long', + limit = 1, + full_results = FALSE, + mode = '', + unique_only = FALSE, + return_addresses = TRUE, + min_time = NULL, + progress_bar = show_progress_bar(), + quiet = getOption("tidygeocoder.quiet", FALSE), + api_url = NULL, + timeout = 20, + flatten = TRUE, + batch_limit = NULL, + batch_limit_error = TRUE, + verbose = getOption("tidygeocoder.verbose", FALSE), + no_query = FALSE, + custom_query = list(), + api_options = list(), + return_type = 'locations', + iq_region = 'us', + geocodio_v = 1.6, + param_error = TRUE, + mapbox_permanent = FALSE, + here_request_id = NULL, + mapquest_open = FALSE + ) { + # NSE - Quote unquoted vars without double quoting quoted vars # end result - all of these variables become character values lat <- rm_quote(deparse(substitute(lat))) diff --git a/R/geocode.R b/R/geocode.R index a480bd55..4d7a1622 100644 --- a/R/geocode.R +++ b/R/geocode.R @@ -57,9 +57,24 @@ #' } #' @seealso [geo] #' @export -geocode <- function(.tbl, address = NULL, street = NULL, city = NULL, county = NULL, - state = NULL, postalcode = NULL, country = NULL, - lat = 'lat', long = 'long', return_input = TRUE, limit = 1, return_addresses = NULL, unique_only = FALSE, ...) { +geocode <- + function( + .tbl, + address = NULL, + street = NULL, + city = NULL, + county = NULL, + state = NULL, + postalcode = NULL, + country = NULL, + lat = 'lat', + long = 'long', + return_input = TRUE, + limit = 1, + return_addresses = NULL, + unique_only = FALSE, + ... + ) { # Non-standard evaluation -------------------------------------------------------------- # Quote unquoted vars without double quoting quoted vars diff --git a/R/geocode_combine.R b/R/geocode_combine.R index 7b953a4c..7294db50 100644 --- a/R/geocode_combine.R +++ b/R/geocode_combine.R @@ -166,9 +166,17 @@ geo_combine <- function(queries, global_params = list(), address = NULL, #' } #' @seealso [geo_combine] [geo] [geocode] #' @export -geocode_combine <- function(.tbl, queries, global_params = list(), - return_list = FALSE, cascade = TRUE, query_names = NULL, - lat = 'lat', long = 'long') { +geocode_combine <- + function( + .tbl, + queries, + global_params = list(), + return_list = FALSE, + cascade = TRUE, + query_names = NULL, + lat = 'lat', + long = 'long' + ) { # NSE - converts lat and long parameters to character values lat <- rm_quote(deparse(substitute(lat))) diff --git a/R/reverse_geo.R b/R/reverse_geo.R index 33f5912f..f4452560 100644 --- a/R/reverse_geo.R +++ b/R/reverse_geo.R @@ -98,14 +98,35 @@ get_coord_parameters <- function(custom_query, method, lat, long) { #' } #' @seealso [reverse_geocode] [api_parameter_reference] [min_time_reference] [batch_limit_reference] #' @export -reverse_geo <- function(lat, long, method = 'osm', address = 'address', limit = 1, - full_results = FALSE, mode = '', unique_only = FALSE, return_coords = TRUE, - min_time = NULL, progress_bar = show_progress_bar(), quiet = getOption("tidygeocoder.quiet", FALSE), - api_url = NULL, timeout = 20, flatten = TRUE, - batch_limit = NULL, verbose = getOption("tidygeocoder.verbose", FALSE), - no_query = FALSE, custom_query = list(), api_options = list(), iq_region = 'us', geocodio_v = 1.6, - mapbox_permanent = FALSE, here_request_id = NULL, mapquest_open = FALSE) { - +reverse_geo <- + function( + lat, + long, + method = 'osm', + address = 'address', + limit = 1, + full_results = FALSE, + mode = '', + unique_only = FALSE, + return_coords = TRUE, + min_time = NULL, + progress_bar = show_progress_bar(), + quiet = getOption("tidygeocoder.quiet", FALSE), + api_url = NULL, + timeout = 20, + flatten = TRUE, + batch_limit = NULL, + verbose = getOption("tidygeocoder.verbose", FALSE), + no_query = FALSE, + custom_query = list(), + api_options = list(), + iq_region = 'us', + geocodio_v = 1.6, + mapbox_permanent = FALSE, + here_request_id = NULL, + mapquest_open = FALSE + ) { + # NSE eval address <- rm_quote(deparse(substitute(address))) diff --git a/R/reverse_geocode.R b/R/reverse_geocode.R index 5f0133ca..217cf651 100644 --- a/R/reverse_geocode.R +++ b/R/reverse_geocode.R @@ -48,8 +48,19 @@ #' } #' @seealso [reverse_geo] #' @export -reverse_geocode <- function(.tbl, lat, long, address = 'address', return_input = TRUE, limit = 1, return_coords = NULL, unique_only = FALSE, ...) { - +reverse_geocode <- + function( + .tbl, + lat, + long, + address = 'address', + return_input = TRUE, + limit = 1, + return_coords = NULL, + unique_only = FALSE, + ... + ) { + # Non-standard evaluation -------------------------------------------------------------- # Quote unquoted vars without double quoting quoted vars # end result - all of these variables become character values