tidyGeography | R Documentation |
Use Google's geocoding API to return geocoded data from a vector of locations.
tidyGeography(x, api.key)
x |
A vector of locations. |
api.key |
Google geocoding API key. |
This fuction iterates through a character vector of locations and returns a data.frame of geocoded variables including country, city, latitude, longitude, etc.
# vector of US postal codes
x <- c('98406', '40601', '32801', '79835', '61701')
# vector of US cities and states
x <- c('Yorba Linda, CA', 'Boise, ID', 'Tulsa, OK', 'Pittsburgh, PA', 'Birmingham, AL')
#vector of cities around the world
x <- c('Okinawa, Japan', 'Lisbon, Portugal', 'Toronto, Canada', 'Melbourne, Australia')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.