Skip to content

Commit

Permalink
docs tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
jessecambon committed Oct 28, 2021
1 parent 234f233 commit da33921
Show file tree
Hide file tree
Showing 18 changed files with 34 additions and 25 deletions.
2 changes: 1 addition & 1 deletion R/api_url.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# API URL Functions ----------------------------------------------------------------
# API URL Functions
# reverse = TRUE for reverse geocoding

## wrapper function for functions below
Expand Down
3 changes: 2 additions & 1 deletion R/batch_geocoding.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
### Functions for batch geocoding that are called by geo()
# Functions for batch (forward) geocoding that are called by geo()


# Census batch geocoding
# @param address_pack packaged addresses object
Expand Down
2 changes: 1 addition & 1 deletion R/documentation.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Functions to produce documentation
# Functions to produce documentation
# Functions return a character vector with one element per line
# to produce roxygen documentation
# see: https://roxygen2.r-lib.org/articles/rd-formatting.html#dynamic-r-code
Expand Down
2 changes: 1 addition & 1 deletion R/geo.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ progress_geo <- function(pb = NULL, ...) {
#' with the name of the `method` (service) it applies to. The possible parameters
#' are shown below with their default values.
#'
#' - `census_return_type` (default: `"locations"`): set to "geographies" to return
#' - `census_return_type` (default: `"locations"`): set to `"geographies"` to return
#' additional geography columns. Make sure to use `full_results = TRUE` if using
#' the "geographies" setting.
#' - `iq_region` (default: `"us"`): set to "eu" to use the European Union API endpoint
Expand Down
6 changes: 4 additions & 2 deletions R/geo_methods.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# The functions in this file are deprecated and will be removed in a future
# version of tidygeocoder


#' Convenience functions for calling `geo()`
#'
#' @description The `method` for `geo()` is specified in the function name.
Expand Down Expand Up @@ -98,8 +102,6 @@ geo_cascade <- function(...) {
}




## private cascade geocoding function
## called from geo() for method = 'cascade'
cascade_geocoding <- function(..., cascade_order = c('census', 'osm')) {
Expand Down
6 changes: 3 additions & 3 deletions R/geocode_combine.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
get_queries_parameter_documentation <- function() {
return(c(
"a list of queries, each provided as a list of parameters. The queries are",
"executed in the order provided by the [geocode] function.",
"executed by the [geocode] function in the order provided.",
"(ex. `list(list(method = 'osm'), list(method = 'census'), ...)`)"
))
}
Expand All @@ -20,8 +20,8 @@ get_global_params_parameter_documentation <- function() {
#' @description Passes address inputs in character vector form to the
#' [geocode_combine] function for geocoding.
#'
#' Note that address inputs must be specified for queries either in `queries` (for each query)
#' or `global_params` (for all queries). For example `global_params = list(address = 'address')`
#' Note that address inputs must be specified for queries either with the `queries` parameter (for each query)
#' or the `global_params` parameter (for all queries). For example `global_params = list(address = 'address')`
#' passes addresses provided in the `address` parameter to all queries.
#'
#' @param queries `r get_queries_parameter_documentation()`
Expand Down
3 changes: 2 additions & 1 deletion R/global_variables.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
### Global package variables
# Global package variables


pkg.globals <- new.env()

Expand Down
7 changes: 7 additions & 0 deletions R/input_handling.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# By default tidygeocoder only sends unique inputs to geocoding services
# but preserves duplicates in outputs. These functions perform the
# deduplication and "re-deduplication" to facilitate that.


# utility function for packaging either lat longs or address data
# takes a dataframe input
# cords = TRUE if processing coordinates
Expand Down Expand Up @@ -84,6 +89,8 @@ package_addresses <- function(address = NULL,
# so that we can return them in the same order that they were passed
# this function assumes that the results are in the same order as package$unique
# Args:
# package: the output of package_inputs() or package_addresses()
# results: the results returned by the geocoding service
# unique_only: if TRUE then only unique results are returned
# return_inputs: if TRUE then include inputs in the returned results
#
Expand Down
3 changes: 2 additions & 1 deletion R/query_factory.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
### Functions for constructing API queries
# Functions for constructing API queries


# Get API Key from environmental variables
get_key <- function(method) {
Expand Down
2 changes: 1 addition & 1 deletion R/reverse_batch_geocoding.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Functions for reverse batch geocoding that are called by reverse_geo()
# Functions for reverse batch geocoding that are called by reverse_geo()


# Reverse Batch geocoding with geocodio
Expand Down
2 changes: 1 addition & 1 deletion R/tidygeocoder.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' The [geocode] and [geo] functions are for forward geocoding while
#' the [reverse_geocode] and [reverse_geo] functions are for reverse geocoding.
#' Refer to the documentation on the `method` argument in the [geo] and [reverse_geo] functions
#' for more details on the available geocoder services. Also see `vignette("tidygeocoder")`
#' for more details on the available geocoding services. Also see `vignette("tidygeocoder")`
#' for example usage.

#' @keywords internal
Expand Down
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Put common utility functions here
# Common utility functions


# utility function for extracting setting values according to the method column
Expand Down
2 changes: 1 addition & 1 deletion man/geo.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/geo_combine.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/geocode_combine.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/reverse_geo.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/tidygeocoder-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions vignettes/developer_notes.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,14 @@ This section documents how to add support for a new geocoding service to the pac
* Update the `extract_results()` function which is used for parsing single addresses (ie. not batch geocoding). You can see examples of how I've tested out parsing the results of geocoding services [here](https://github.com/jessecambon/tidygeocoder/tree/main/sandbox/query_debugging).
* In a similar fashion, update the `extract_reverse_results()` function for reverse geocoding.
* Update the `extract_errors_from_results()` function to extract error messages for invalid queries.
* **[R/geo_methods.R](https://github.com/jessecambon/tidygeocoder/blob/main/R/geo_methods.R)**
* Add a new `geo_<method>()` convenience function to [R/geo_methods.R](https://github.com/jessecambon/tidygeocoder/blob/main/R/geo_methods.R). Note that these functions are deprecated and will be phased out in the future.
* If applicable, add new tests to the scripts in the [tests directory](https://github.com/jessecambon/tidygeocoder/tree/main/tests/testthat) for the method. Note that tests should avoid making a HTTP query (ie. use `no_query = TRUE` in the `geo()` and `geocode()` functions).
* **[R/global_variables.R](https://github.com/jessecambon/tidygeocoder/blob/main/R/global_variables.R)**
* If applicable, add your service to one of the global variables.
* If applicable, add your service to one of the global variables.

### Other Files

These files don't necessarily need to be updated. However, you might need to make changes to these files if the service you are implementing requires some non-standard workarounds.


* **[R/query_factory.R](https://github.com/jessecambon/tidygeocoder/blob/main/R/query_factory.R)**
* Houses the functions used to create and execute API queries.
* **[R/documentation.R](https://github.com/jessecambon/tidygeocoder/blob/main/R/documentation.R)**
Expand Down

0 comments on commit da33921

Please sign in to comment.