Description Usage Arguments Value
View source: R/Google_drivetime.R
Google_drivetime
is designed to take degree or
radian geocoordinates or location names, user app credentials
, and some other API inputs (set to defaults). The function queries the
Google Directions API (
https://developers.google.com/maps/documentation/directions/
intro#DirectionsRequests)
and return
the drive time from the JSON output code. This drive time portion of the JSON
is originally return in minutes. This function is designed to take an
argument for the user preferred time (seconds, minutes, or hours).
1 2 3 4 5 6 7 8 9 10 11 12 |
origin |
a string or vector of two numerics; if a location string, this should be an address, if a vector of length two numerics this should be the latitude and longitude coordinates for the origin location |
destination |
a string or vector of two numerics; if a location string, this should be an address, if a vector of length two numerics this should be the latitude and longitude coordinates for the destination location |
key |
a string; the user's App Code for the Google.com JavaScript/REST (requires registration) |
mode |
a string; a transportation method for the route:
|
transit_mode |
a string; sub-type for
|
transit_routing_preference |
a string; specifies preferences for the
|
time_format |
a string; the preferred time format for results:
|
distance_format |
a string; the pregerred format for measuring distance:
|
coordinate_type |
a string; if using geocoordinates, whether they are in degrees or radians:
|
verbose |
a boolean; |
the travel time and distance as specified between two locations
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.