pull_geo_data: Pull Google Maps data with error handling

Description Usage Arguments Value Examples

View source: R/pull_geo_data.R

Description

This function, primarily, is a helper for drive_time and geocode_url. It attempts to pull Google Maps data for a complete URL, recording http errors/connection failures within the status and error_message paramaters. To debug invalid signature requests, refer to the Google Developer documention.

Usage

1
pull_geo_data(urls_out, tmout = 10, messages = TRUE)

Arguments

urls_out

character string; a complete URL with valid character encoding.

tmout

number; the length of time, in seconds, to wait for a valid server response before triggering a connection timeout error (defaults to 10 seconds).

messages

logical; when TRUE, displays message from the API call(s). Generally, this parameter is passed from drive_time or geocode_url.

Value

A list with validly formatted JSON objects whose length equals urls_out

Examples

1
2
3
4
5
6
## Not run: 
# Fetch URLs contained within character vector "togoogle", waiting 20 seconds
# before triggering a server timeout error.
output <- pull_geo_data(togoogle, tmout=20)

## End(Not run)

placement documentation built on May 29, 2017, 11:54 p.m.