Returns next bus arrival times at a stop.
next_bus(StopID, api_key = wmata_key())
A tibble 1 row per arrival with 8 variables:
7-digit regional ID which can be used in various bus-related
methods. If unavailable, the StopID
will be 0 or NA
Stop name. May be slightly different from what is spoken or displayed in the bus.
Base route name as shown on the bus. This can be used in other bus-related methods. Note that all variants will be shown as their base route names (i.e.: 10Av1 and 10Av2 will be shown as 10A).
Customer-friendly description of direction and destination for a bus.
Denotes a binary direction (0 or 1) of the bus. There is no specific mapping to direction, but a different value for the same route signifies that the buses are traveling in opposite directions. Use the DirectionText element to show the actual destination of the bus.
Minutes until bus arrival at this stop. Numeric value.
Bus identifier. This can be correlated with results returned from bus positions.
Trip identifier. This can be correlated with the data in our bus schedule information as well as bus positions.
7-digit regional stop ID.
Subscription key which provides access to this API. Defaults
Sys.getenv("WMATA_KEY")
via wmata_key()
.
Data frame of bus arrivals.
Other Real-Time Predictions:
next_train()
if (FALSE) {
next_bus(StopID = "1001195")
}