geocodeAddresses: Get the coordinates of several addresses

Description Usage Arguments Value Examples

View source: R/geocodeAddresses.R

Description

Get the coordinates of many addresses using the Google Maps API.

Usage

1
2
3
geocodeAddresses(addresses, prev.results = NULL, address.components = TRUE,
                 print.progress = TRUE, pause.time = 0.02,
                 progress.save.file = NULL)

Arguments

addresses

The address to search for as a character vector. These should be as clear as possible, i.e. "Street, City, State, Country"

prev.results

If bulk searching for many addresses, you may be cut off part of the way through. By providing the output of a previous call of this function, the already-found locations will be skipped.

address.components

Whether or not the addresses of the found locations should be included in the results (useful for checking accuracy). If FALSE, only the coordinates will be returned.

print.progress

Whether or not the progress of the function should be shown.

pause.time

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

progress.save.file

If a file name is provided, the function will save the progress after each request. It saves as an .rds file which can be loaded with readRDS()

Value

Returns a data.frame with the coordinates (and address components if requested) for each location in addresses.

Examples

1
2
  addresses <- c("Time Square, New York City", "24 Beacon St, Boston, MA")
  geocodeAddresses(addresses)

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