tidyGeography: Use Google's geocoding API to return geocoded data from a...

View source: R/geo.R

tidyGeographyR Documentation

Use Google's geocoding API to return geocoded data from a vector of locations.

Description

Use Google's geocoding API to return geocoded data from a vector of locations.

Usage

tidyGeography(x, api.key)

Arguments

x

A vector of locations.

api.key

Google geocoding API key.

Details

This fuction iterates through a character vector of locations and returns a data.frame of geocoded variables including country, city, latitude, longitude, etc.

Examples

# 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')

NumbersInternational/flipTransformations documentation built on Feb. 26, 2024, 6:43 a.m.