getGeoCode: geocoding utility

Description Usage Arguments Value Author(s) Examples

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

1
getGeoCode(gcStr, JSON = FALSE, verbose = 0)

Arguments

gcStr

adddress to geocode

JSON

use the JSON protocol. If FALSE, we do not have to load additional libraries

verbose

level of verbosity

Value

returns lat/lon for address

Author(s)

Markus Loecher

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
getGeoCode("1600 Amphitheatre Parkway, Mountain View, CA")


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

RgoogleMaps documentation built on May 2, 2019, 5:03 p.m.