Learn R Programming

ggmap (version 1.3)

geocode: Geocode

Description

geocodes a location using Google Maps.

Usage

geocode(location,
    output = c("latlon", "latlona", "more", "all"),
    messaging = FALSE)

Arguments

location
a character string specifying a location of interest (e.g. "Baylor University")
output
amount of output
messaging
turn messaging on/off

Value

  • depends (at least a data.frame with variables lon and lat)

Details

note that the google maps api limits to 2500 queries a day.

See Also

http://code.google.com/apis/maps/documentation/geocoding/

Examples

Run this code
geocode('Baylor University')
geocode('1600 Pennsylvania Avenue, Washington DC')
geocode('1600 Pennsylvania Avenue, Washington DC', messaging = TRUE)
geocode('the white house', messaging = TRUE)
geocode('the eiffel tower')
geocode(c('baylor university', 'salvation army waco', 'HEB #087 waco'))
geocode(c('baylor university', 'the vatican'))
geocode(c('baylor university', 'the vatican'), output = 'latlona')
geocode(c('baylor university', 'the vatican'), output = 'more')
geocode('the eiffel tower', output = 'all')

Run the code above in your browser using DataLab