diff --git a/NEWS.md b/NEWS.md index 798aca8d..e16b9721 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,8 @@ # tidygeocoder (development version) - Corrected documentation for `quiet` parameter in `geo()` and `reverse_geo()` +- Reconfigured the vignette so that it is precomputed and is not executed during +`R CMD check` (ie. `devtools::check()`). Also added a check at the beginning of the vignette to check for the availability of APIs. This fixes an issue that occurred on Mac CRAN checks ([#152](https://github.com/jessecambon/tidygeocoder/issues/152)). # tidygeocoder 1.0.4 diff --git a/R/geo.R b/R/geo.R index c84c671f..1dc1eb1b 100644 --- a/R/geo.R +++ b/R/geo.R @@ -71,19 +71,19 @@ progress_geo <- function(pb = NULL, ...) { #' #' @param min_time minimum amount of time for a query to take (in seconds). If NULL #' then min_time will be set to the default value specified in [min_time_reference]. -#' @param progress_bar if TRUE then a progress bar will be displayed to track query -#' progress for single input geocoding (1 input per query). By default the progress bar +#' @param progress_bar if TRUE then a progress bar will be displayed +#' for single input geocoding (1 input per query). By default the progress bar #' will not be shown for code executed when knitting R Markdown files or code within #' an RStudio notebook chunk. Can be set permanently with `options(tidygeocoder.progress_bar = FALSE)`. #' @param quiet if TRUE then console messages that are displayed by default -#' regarding queries will be suppressed. Can be set permanently with `options(tidygeocoder.quiet = TRUE)`. +#' regarding queries will be suppressed. FALSE is default. +#' Can be set permanently with `options(tidygeocoder.quiet = TRUE)`. #' @param api_url custom API URL. If specified, the default API URL will be overridden. #' This parameter can be used to specify a local Nominatim server, for instance. #' @param timeout query timeout (in minutes) #' #' @param flatten if TRUE (default) then any nested dataframes in results are flattened if possible. -#' Note that in some cases results are flattened regardless such as for -#' Geocodio batch geocoding. +#' Note that in some cases results are flattened regardless such as for Geocodio batch geocoding. #' @param batch_limit `r get_batch_limit_documentation(reverse = FALSE)` #' @param batch_limit_error `r lifecycle::badge("deprecated")` `r get_batch_limit_error_documentation(reverse = FALSE)` #' @param verbose if TRUE then detailed logs are output to the console. FALSE is default. Can be set diff --git a/docs/articles/developer_notes.html b/docs/articles/developer_notes.html index 3b883630..fadad31a 100644 --- a/docs/articles/developer_notes.html +++ b/docs/articles/developer_notes.html @@ -302,7 +302,13 @@
verbose = TRUE
to make sure it behaves as expected. You can reference tests available the ‘sandbox’ folder for reference.devtools::check()
to make sure the package still passes all tests and the vignette runs properly. To only run the package tests use devtools::test()
, but note these tests do not query the geocoding services to avoid external dependencies.devtools::test()
) because they require API keys which would not exist on all systems and are dependent on the geocoding services being online at that the time of the test.devtools::check()
to make sure the package still passes all tests and checks. To only run the package tests use devtools::test()
, but note these tests do not query the geocoding services to avoid external dependencies.devtools::test()
) because they require API keys which would not exist on all systems and are dependent on the geocoding services being online at that the time of the test.urlchecker::url_check()
to check all package URLs.singlelineaddress | @@ -222,7 +222,7 @@
---|
street | @@ -255,7 +255,7 @@
---|
address | @@ -367,15 +367,15 @@Salzburg, Austria | 47.79813 | 13.04648 | -257918086 | -relation | -86538 | -47.7512115, 47.8543925, 12.9856478, 13.1272842 | +214457 | +node | +34964314 | +47.6381346, 47.9581346, 12.8864806, 13.2064806 | Salzburg, 5020, Österreich | -boundary | -administrative | +place | +city | 0.6854709 | -https://nominatim.openstreetmap.org/ui/mapicons//poi_boundary_administrative.p.20.png | +https://nominatim.openstreetmap.org/ui/mapicons//poi_place_city.p.20.png |
---|
To directly specify specific API parameters for a given method
you can use the custom_query
parameter. For example, the Nominatim (OSM) geocoder has a ‘polygon_geojson’ argument that can be used to return GeoJSON geometry content. To pass this parameter you can insert it with a named list using the custom_query
argument:
cairo_geo <- geo("Cairo, Egypt",
@@ -724,7 +724,7 @@
#> polygon_geojson : "1"
#> format : "json"
#> HTTP Status Code: 200
-#> Query completed in: 0.2 seconds
+#> Query completed in: 0.1 seconds
#> Total query time (including sleep): 1 seconds
#>
#> Query completed in: 1 seconds
@@ -735,15 +735,15 @@
#> $ lat <dbl> 30.03521
#> $ long <dbl> 31.56337
#> $ place_id <int> 258758158
-#> $ licence <chr> "Data © OpenStreetMap contributors, ODbL 1.0. http…
+#> $ licence <chr> "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright"
#> $ osm_type <chr> "relation"
#> $ osm_id <int> 5466227
-#> $ boundingbox <list> <"29.7483062", "30.3209168", "31.2200331", "31.909…
+#> $ boundingbox <list> <"29.7483062", "30.3209168", "31.2200331", "31.9090054">
#> $ display_name <chr> "القاهرة, محافظة القاهرة, مصر"
#> $ class <chr> "place"
#> $ type <chr> "city"
#> $ importance <dbl> 0.6960286
-#> $ icon <chr> "https://nominatim.openstreetmap.org/ui/mapicons//…
+#> $ icon <chr> "https://nominatim.openstreetmap.org/ui/mapicons//poi_place_city.p.20.png"
#> $ geojson.type <chr> "Polygon"
#> $ geojson.coordinates <list> <<array[1 x 119 x 2]>>
To test a query without sending any data to a geocoding service, you can use no_query = TRUE
(NA results are returned).
quiet
parameter in geo()
and reverse_geo()
R CMD check
(ie. devtools::check()
). Also added a check at the beginning of the vignette to check for the availability of APIs. This fixes an issue that occurred on Mac CRAN checks (#152).if TRUE then a progress bar will be displayed to track query -progress for single input geocoding (1 input per query). By default the progress bar +
if TRUE then a progress bar will be displayed
+for single input geocoding (1 input per query). By default the progress bar
will not be shown for code executed when knitting R Markdown files or code within
an RStudio notebook chunk. Can be set permanently with options(tidygeocoder.progress_bar = FALSE)
.
if TRUE then console messages that are displayed by default
-regarding queries will be suppressed. Can be set permanently with options(tidygeocoder.quiet = TRUE)
.
options(tidygeocoder.quiet = TRUE)
.
if TRUE (default) then any nested dataframes in results are flattened if possible. -Note that in some cases results are flattened regardless such as for -Geocodio batch geocoding.
# \donttest{ geo(street = "600 Peachtree Street NE", city = "Atlanta", state = "Georgia", method = "census") -#>#>#> # A tibble: 1 × 5 +#>#>#> # A tibble: 1 × 5 #> street city state lat long #> <chr> <chr> <chr> <dbl> <dbl> #> 1 600 Peachtree Street NE Atlanta Georgia 33.8 -84.4geo("100 Main St New York, NY", full_results = TRUE, method = "census", api_options = list(census_return_type = 'geographies')) -#>#>#> # A tibble: 1 × 28 +#>#>#> # A tibble: 1 × 28 #> address lat long matchedAddress tigerLine.tiger… tigerLine.side #> <chr> <dbl> <dbl> <chr> <chr> <chr> #> 1 100 Main St New York, NY 40.7 -74.0 100 MAIN ST, … 59662602 R diff --git a/docs/reference/geo_combine.html b/docs/reference/geo_combine.html index f99c0922..72f798f0 100644 --- a/docs/reference/geo_combine.html +++ b/docs/reference/geo_combine.html @@ -282,7 +282,7 @@Examp address = example_addresses, global_params = list(address = 'address') ) -
#>#>#>#>#>#>#> # A tibble: 3 × 4 +#>#>#>#>#>#>#> # A tibble: 3 × 4 #> address lat long query #> <chr> <dbl> <dbl> <chr> #> 1 100 Main St New York, NY 40.7 -74.0 "census" @@ -299,7 +299,7 @@Examp cascade = FALSE, return_list = TRUE ) -
#>#>#>#>#>#>#>#>#>#> $arcgis +#>#>#>#>#>#>#>#>#>#> $arcgis #> # A tibble: 3 × 3 #> address lat long #> <chr> <dbl> <dbl> @@ -332,7 +332,7 @@Examp country = c('Japan', 'United States'), cascade = FALSE ) -
#>#>#>#>#>#>#> # A tibble: 4 × 5 +#>#>#>#>#>#>#> # A tibble: 4 × 5 #> city country lat long query #> <chr> <chr> <dbl> <dbl> <chr> #> 1 Tokyo Japan 35.7 140. arcgis diff --git a/docs/reference/geocode.html b/docs/reference/geocode.html index b06a2f64..8766d13a 100644 --- a/docs/reference/geocode.html +++ b/docs/reference/geocode.html @@ -310,7 +310,7 @@Examp louisville %>% head(2) %>% geocode(street = street, city = city, state = state, postalcode = zip, method = 'census', full_results = TRUE) -
#>#>#> # A tibble: 2 × 15 +#>#>#> # A tibble: 2 × 15 #> street city state zip latitude longitude lat long id input_address #> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <int> <chr> #> 1 2722 ELLIOTT AVE Loui… Kent… 40211 38.3 -85.8 38.3 -85.8 1 2722 ELLIOTT… diff --git a/docs/reference/geocode_combine.html b/docs/reference/geocode_combine.html index a4d3917a..90d03d9b 100644 --- a/docs/reference/geocode_combine.html +++ b/docs/reference/geocode_combine.html @@ -269,7 +269,7 @@Examp geocode_combine( queries = list(list(method = 'census'), list(method = 'osm')), global_params = list(address = 'addr'), cascade = TRUE) -
#>#>#>#>#>#>#> # A tibble: 9 × 5 +#>#>#>#>#>#>#> # A tibble: 9 × 5 #> name addr lat long query #> <chr> <chr> <dbl> <dbl> <chr> #> 1 White House 1600 Pennsylvania Ave NW Washington, … 38.9 -77.0 cens… @@ -300,7 +300,7 @@Examp city = 'city', state = 'state', postalcode = 'zip_cd'), query_names = c('census batch', 'census single', 'osm') ) -
#>#>#>#>#>#>#>#>#>#> # A tibble: 4 × 7 +#>#>#>#>#>#>#>#>#>#> # A tibble: 4 × 7 #> street_address city state zip_cd lat long query #> <chr> <chr> <chr> <dbl> <dbl> <dbl> <chr> #> 1 624 W DAVIS ST #1D BURLINGTON NC 27215 36.1 -79.4 census single @@ -317,7 +317,7 @@Examp cascade = FALSE, return_list = TRUE ) -
#>#>#>#>#>#>#> $census +#>#>#>#>#>#>#> $census #> # A tibble: 4 × 6 #> street_address city state zip_cd lat long #> <chr> <chr> <chr> <dbl> <dbl> <dbl> diff --git a/docs/reference/reverse_geo.html b/docs/reference/reverse_geo.html index 8deb1b59..ab8a000c 100644 --- a/docs/reference/reverse_geo.html +++ b/docs/reference/reverse_geo.html @@ -298,15 +298,16 @@Arg
if TRUE then a progress bar will be displayed to track query -progress for single input geocoding (1 input per query). By default the progress bar +
if TRUE then a progress bar will be displayed
+for single input geocoding (1 input per query). By default the progress bar
will not be shown for code executed when knitting R Markdown files or code within
an RStudio notebook chunk. Can be set permanently with options(tidygeocoder.progress_bar = FALSE)
.
if TRUE then console messages that are displayed by default
-regarding queries will be suppressed. Can be set permanently with options(tidygeocoder.quiet = TRUE)
.
options(tidygeocoder.quiet = TRUE)
.
if TRUE (default) then any nested dataframes in results are flattened if possible. -Note that in some cases results are flattened regardless such as for -Geocodio batch geocoding.