Description Usage Arguments Value Author(s) Examples
Geocode character vectors (or data.frames) using Google or Bing's API
1 2 3 4 5 6 7 8 9 10 | geocode(x, verbose = FALSE, service = "google",
returntype = "coordinates", ...)
## Default S3 method:
geocode(x, verbose = FALSE, service = "google",
returntype = "coordinates", ...)
## S3 method for class 'data.frame'
geocode(x, verbose = FALSE, service = "google",
returntype = "coordinates", addresscol = "address", ...)
|
x |
A vector or data.frame |
verbose |
Whether to display each address as it is submitted to Google or not |
service |
API to use. Current options are "bing" or "google". To add your Bing API key, set options(BingMapsKey="yourkeygoeshere"). |
returntype |
What to return. Options include "coordinates" and "zip". |
addresscol |
A (character) name of the column in a data.frame which contains the addresses |
... |
Other items to pass along |
geocode.default returns a numeric vector of length 2 containing the latitudes and longitudes. geocode.data.frame returns the original data.frame with two additional columns for the longitude and latitudes.
Error handling, object orientation, and Bing capabilities by Ari Friedman. Google REST algorithm by Tony Breyal (http://stackoverflow.com/a/3259537/636656).
1 2 3 4 5 6 7 8 9 10 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.