Description Usage Arguments Value Examples
The function geocodes a single address given as a character string. Be as specific as possible, including the country or postcode to avoid ambiguity. To avoid loss of accuracy when geocoding a lat/lng string, the geoCode function does not geocode lat/lng strings but instead returns the same string as a dataframe.
1 2 3 4 5 6 | geocode(
address,
api_key = Sys.getenv("google_api_key"),
verbose = FALSE,
return_all = TRUE
)
|
address |
character string with address to be geocoded. Be as specific as possible to avoid ambiguity. |
api_key |
character string containing api key for the google maps geocode api. You can generate one for free in your google cloud console. |
verbose |
logical value. If TRUE, echos the input address |
return_all |
logical value. Some locations may return more than one geocoded result. If you only want one row returned set return_all = FALSE. |
a data.frame containing the coordinates, location type and approximate address.
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.