Returns schedules for a given route variant for a given date.

bus_schedule(
  RouteID,
  IncludingVariations = TRUE,
  Date = NULL,
  api_key = wmata_key()
)

Format

A data frame with 1 row per trip and 10 variables:

RouteID

Bus route variant. This can be used in several other bus methods which accept variants.

TripDirectionText

General direction of the trip (NORTH, SOUTH, EAST, WEST, LOOP, etc.).

TripHeadsign

Descriptive text of where the bus is headed. This is similar, but not necessarily identical, to what is displayed on the bus.

StartTime

Scheduled start date and time (UTC) for this trip.

EndTime

Scheduled end date and time (UTC) for this trip.

TripID

Unique trip ID. This can be correlated with the data returned from the schedule-related methods.

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.

StopSeq

Order of the stop in the sequence of StopTimes.

Time

Scheduled departure date and time (UTC) from this stop.

Arguments

RouteID

Bus route variant, e.g.: 70, 10A, 10Av1, etc.

IncludingVariations

Whether or not to include variations if a base route is specified in RouteID. For example, if B30 is specified and IncludingVariations is set to TRUE (default), data for all variations of B30 such as B30v1, B30v2, etc. will be returned.

Date

(Optional) Date for which to retrieve route and stop information.

api_key

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

Value

Data frame containing trip information

Examples

if (FALSE) {
bus_schedule("70")
}