Learn R Programming

RgoogleMaps (version 1.2.0.7)

getGeoCode: geocoding utility

Description

Geocode your data using, R, JSON and Google Maps' Geocoding APIs

see http://allthingsr.blogspot.de/2012/01/geocode-your-data-using-r-json-and.html

and

Usage

getGeoCode(gcStr, verbose = 0)

Arguments

gcStr
adddress to geocode
verbose
level of verbosity

Value

Examples

Run this code


getGeoCode("Brooklyn")


#You can run this on the entire column of a data frame or a data table:


DF = cbind.data.frame(address=c("Berlin,Germany", "Princeton,NJ", 


          "cadillac+mountain+acadia+national+park"), lat = NA, lon = NA)


DF <- with(DF, data.frame(address, t(sapply(DF$address, getGeoCode))))





Run the code above in your browser using DataLab