next_bus: Next Buses

View source: R/next-bus.R

next_busR Documentation

Next Buses

Description

Returns next bus arrival times at a stop.

Usage

next_bus(StopID, api_key = wmata_key())

Arguments

StopID

7-digit regional stop ID.

api_key

Subscription key which provides access to this API. Defaults Sys.getenv("WMATA_KEY") via wmata_key().

Format

A tibble 1 row per arrival with 8 variables:

StopID

7-digit regional ID which can be used in various bus-related methods. If unavailable, the StopID will be 0 or NA

StopName

Stop name. May be slightly different from what is spoken or displayed in the bus.

RouteID

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).

DirectionText

Customer-friendly description of direction and destination for a bus.

DirectionNum

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

Minutes until bus arrival at this stop. Numeric value.

VehicleID

Bus identifier. This can be correlated with results returned from bus positions.

TripID

Trip identifier. This can be correlated with the data in our bus schedule information as well as bus positions.

Value

Data frame of bus arrivals.

See Also

https://developer.wmata.com/docs/services/5476365e031f590f38092508/operations/5476365e031f5909e4fe331d

Other Real-Time Predictions: next_train()

Examples

## Not run: 
next_bus(StopID = "1001195")

## End(Not run)

metro documentation built on Nov. 2, 2023, 6:06 p.m.