Returns opening and scheduled first/last train times based on a given
StationCode
. Omit the StationCode
to return timing information for all
stations.
rail_times(StationCode = NULL, api_key = wmata_key())
A tibble 1 row per train with 8 variables:
Station code for this station. Use this value in other rail-related APIs to retrieve data about a station.
Full name of the station.
Station code for the train's destination. Use this value in other rail-related APIs to retrieve data about a station.
Day of the week abbreviation. From list element names.
Station opening time. Converted to hms
class with
hms::parse_hm()
, representing seconds since midnight of that Weekday
.
First train leaves the station at this time (ET).
Converted to hms
class with hms::parse_hm()
, representing seconds since
midnight of that Weekday
.
Last train leaves the station at this time (ET). Converted
to hms
class with hms::parse_hm()
, representing seconds since midnight
of that Weekday
. For times that were in the AM of the next Weekday
,
time is greater than 24 hours.
Station code. Use the rail_stations()
function to return
a list of all station codes. Use NULL
(default) to return times for all
stations.
Subscription key which provides access to this API. Defaults
Sys.getenv("WMATA_KEY")
via wmata_key()
.
A tidy data frame of station schedules. Combined from a nested list of weekday times.
Note that for stations with multiple platforms (e.g.: Metro Center, L'Enfant
Plaza, etc.), a distinct call is required for each StationCode
to retrieve
the full set of train times at such stations.
Other Rail Station Information:
rail_destination()
,
rail_entrance()
,
rail_lines()
,
rail_path()
,
rail_stations()
,
station_info()
if (FALSE) {
rail_times("A01")
}