Geocodes addresses using the HERE 'Geocoder' API.

geocode(addresses, autocomplete = FALSE, sf = TRUE, url_only = FALSE)

Arguments

addresses

character, addresses to geocode.

autocomplete

boolean, use the 'Geocoder Autocomplete' API to autocomplete addresses? Note: This options doubles the amount of requests (default = FALSE).

sf

boolean, return an sf object (default = TRUE) or a data.frame?

url_only

boolean, only return the generated URLs (default = FALSE)?

Value

If sf = TRUE, an sf object, containing the coordinates of the geocoded addresses as a geometry list column. If sf = FALSE, a data.frame containing the coordinates of the geocoded addresses as lng, lat columns.

References

HERE Geocoder API: Geocode

Examples

# Provide an API Key for a HERE project set_key("<YOUR API KEY>") locs <- geocode(addresses = poi$city, url_only = TRUE)