Description Usage Arguments Value Examples
View source: R/calculate_distance.R
distances_mapquest
creates and executes calls to MapQuest
directions API via HTTP GET and returns the distance between two points.
1 | distances_mapquest(from, to, route_type = "shortest", key)
|
from |
A string address |
to |
A string address |
route_type |
A string specifying the type of route. Acceptable options include "fastest", "shortest", "pedestrian", "bicycle". More information can be found here: https://developer.mapquest.com/documentation/directions-api/route/get/ |
key |
An individual API authentication key. MapQuest provides 15,000 free monthly transactions with a non-gated account. An account can be created here: https://developer.mapquest.com/plan_purchase/steps/business_edition/business_edition_free/register |
A dataframe will be returned with the given addresses and their corresponding latitudes and longitudes. These are attributed to the closest street location.
1 2 | distances_mapquest(from = "1555 Blake St Denver, CO 80202",
to = "2 Cedar St Newark, NJ 07102", key = Sys.getenv("MAPQUEST_API_KEY"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.