geocodeAddress: Get the coordinates of an address

Description Usage Arguments Details Value Examples

View source: R/geocodeAddress.R

Description

Get the coordinates of an address using the Google Maps API.

Usage

1
geocodeAddress(address, result = 1, pause.time = 0.02)

Arguments

address

The address to search for as a string, e.g. address = "Time Square, New York City"

result

Which search result to use. The default is the first result.

pause.time

Amount of time in seconds to wait after a request (if performing multiple requests in a loop).

Details

By default the function returns the first result from the search. This can be checked for accuracy by looking at the address component in the result. If this is incorrect, the second result can be tried using result = 2

Value

crd

A vector of the longitude and latitude of the address.

address

A data.frame with the various components of the address.

Examples

1
2
3
  geocodeAddress("Time Square, New York City")
  geocodeAddress("Boston")
  geocodeAddress("Boston", result = 2)

walshc/GoogleMapsAPI documentation built on May 3, 2019, 11:50 p.m.