bus_schedule: Bus Schedule

View source: R/bus-schedule.R

bus_scheduleR Documentation

Bus Schedule

Description

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

Usage

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

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

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.

Value

Data frame containing trip information

See Also

https://developer.wmata.com/docs/services/54763629281d83086473f231/operations/5476362a281d830c946a3d6b

Other Bus Route and Stop Methods: bus_departs(), bus_path(), bus_position(), bus_routes(), bus_stops()

Examples

## Not run: 
bus_schedule("70")

## End(Not run)

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