The boxgooglemap package is connected with the google geocode API to convert location and coordination by two function:
package httr is required to be installed
The 'address' function retrive the address of a given coordinate. The funtion uses the google geocode API to retrieve the result.
The input latlong is a character string that includes the latitude and the longitude.
The function returns a dataframe cointaining full address names as well as the coordinates:
library(boxgooglemap) head(address("41.40450 76"), n = 5) tail(address("67 115"), n = 5)
The 'coord' function is a function that provides the user with the coordinates of a given address. The function uses the google geocode API to retrieve the result.
Please input address, a character string that includes address components.
If the address has partial match, different locations with their full names and coordinates will be retrieved as a dataframe:
library(boxgooglemap) coord("chang sha, china") coord("milan")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.