Learn R Programming

MBTAr (version 2.0.0)

Ttraveltimes: Query travel times and travel time performance

Description

Returns a list of travel times between an origin destination pair during a particular time period.

Usage

Ttraveltimes(from_stop_id, to_stop_id, route_id = NULL,
  from_datetime = (Sys.time() - 3600),
  to_datetime = Sys.time(),
  api_key)

Arguments

from_stop_id

GTFS-compatible stop_id for the origin stop for which travel times should be returned.

to_stop_id

GTFS-compatible stop_id for the destination stop for which travel times should be returned.

route_id

GTFS-compatible route_id value for which travel times should be returned. If this is not included, travel times for all routes between the from and to stop will be provided.

from_datetime

The start of the time period that the travel time (arrival time at the destination stop) should fall within; converts to epoch time.

to_datetime

The end of the time period that the travel time (arrival time at the destination stop) should fall within; converts to epoch time.

api_key

API key for MBTA API. To obtain one, visit the MBTA Developer Portal (https://mbta.com/developers/mbta-performance)

Value

route_id

Route ID for which travel time are returned.

direction

Direction id for which travel times are returned.

dep_dt

Actual departure times from origin stop during the time window specified.

arr_dt

Actual arrival times at destination stop during the time window specified.

travel_time_sec

Actual travel times for all trips during time window specified, in seconds.

benchmark_travel_time_sec

Benchmark travel times for each trip, in seconds. Benchmarks are based on median travel times during the last 30 days.