Description Usage Arguments Value Examples
To get headways and train arrive times for a given station/route/direction in a certain time window.. Returns a list of headways at an origin station during a particular time period on a particular route.
1 2 3 |
from_stop_id |
GTFS-compatible stop_id for the origin stop for which headways should be returned. |
to_stop_id |
GTFS-compatible stop_id for the destination stop for which headways should be returned. If empty will use departures from origin stop with any destination stop on that route (i.e. not distinguishing between branches). |
route_id |
GTFS-compatible route_id value for which headways should be returned. If this is not included, headways for all routes between the from and to stop will be provided. |
direction_id |
Direction of travel for headways to be returned. If empty, will rely on |
from_datetime |
The start of the time period that the headways (arrival time at the origin stop) should fall within; converts to epoch time. |
to_datetime |
The end of the time period that the headways (arrival time at the origin stop) should fall within; converts to epoch time. |
api_key |
API key for MBTA Performance API. To obtain one, visit the MBTA Developer Portal (https://mbta.com/developers/mbta-performance/) |
Arrival times for vehicles at the particular origin stop during the time window requested.
route_id |
GTFS-compatible route identifier for which headways are returned. |
direction |
Direction id (0/1) for which headways are returned. |
current_dep_dt |
Next departure time from origin stop during the time window specified. |
previous_dep_dt |
Previous departure time at destination stop during the time window specified. |
headway_time_sec |
Actual headway for next arriving vehicle during time window specified, in seconds. |
benchmark_headway_time_sec |
Benchmark headway for each trip, in seconds. |
threshold_01_flag |
Binary variable for whether a given headway was above the first threshold for delayed headways. |
threshold_02_flag |
Binary variable for whether a given headway was above the second threshold for delayed headways. |
threshold_03_flag |
Binary variable for whether a given headway was above the third threshold for delayed headways. |
1 2 3 4 5 6 7 8 | Theadways(from_stop_id = 70007, # Jackson Square Northbound
to_stop_id = 70034, # Malden Southbound
route_id = NULL,
direction_id = 1, # northbound
from_datetime = as.POSIXct("2015-08-03 00:00"),
to_datetime = as.POSIXct("2015-08-03 23:59"),
api_key = "wX9NwuHnZU2ToO7GmGR9uw")
#'
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.