- origins
The input coordinates of your request. Acceptable inputs include a list of
coordinate pair vectors in c(x, y) format or an sf object.
For sf linestrings or polygons, the distance between centroids will be taken.
- destinations
The destination coordinates of your request. If NULL (the default), a many-to-many matrix using origins will be returned.
- profile
One of "driving" (the default), "driving-traffic", "walking", or "cycling".
- fallback_speed
A value expressed in kilometers per hour used to estimate travel time when a route cannot be found between locations. The returned travel time will be based on the straight-line estimate of travel between the locations at the specified fallback speed.
- output
one of "duration" (the default), which will be measured in either minutes or seconds (depending on the value of duration_output), or "distance", which will be returned in meters.
- duration_output
one of "minutes" (the default) or "seconds"
- access_token
A Mapbox access token (required)
- depart_at
(optional) For the "driving" or "driving-traffic" profiles, the departure date and time to reflect historical traffic patterns. If "driving-traffic" is used, live traffic will be mixed in with historical traffic for dates/times near to the current time. Should be specified as an ISO 8601 date/time, e.g. "2023-03-31T09:00". The time must be set to the current time or in the future.
- allow_large_matrix
mb_matrix() will prevent the user from calculating large travel-time matrices (greater than 25x25) by default, as they may lead to unexpected charges. If the user sets this argument to TRUE, mb_matrix() will bypass this error and calculate the large matrix for the user. Defaults to FALSE.