Learn R Programming

metro (version 0.9.3)

rail_path: Path Between Stations

Description

Returns a set of ordered stations and distances between two stations on the same line.

Usage

rail_path(FromStationCode, ToStationCode, api_key = wmata_key())

Value

A data frame of stations on rail path.

Format

A tibble 1 row per arrival with 6 variables:

LineCode

Two-letter abbreviation for the line (e.g.: RD, BL, YL, OR, GR, or SV) this station's platform is on.

StationCode

Station code for this station. Use this value in other rail-related APIs to retrieve data about a station.

StationName

Full name for this station, as shown on the WMATA website.

SeqNum

Ordered sequence number.

DistanceToPrev

Distance in meters to the previous station in the list, ordered by SeqNum. Converted from feet, rounded to the nearest meter.

Arguments

FromStationCode

Station code for the origin station. Use the Station List method to return a list of all station codes.

ToStationCode

Station code for the destination station. Use the Station List method to return a list of all station codes.

api_key

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

Details

Note that this method is not suitable on its own as a pathfinding solution between stations.

See Also

https://developer.wmata.com/docs/services/5476364f031f590f38092507/operations/5476364f031f5909e4fe330e

Other Rail Station Information: rail_destination(), rail_entrance(), rail_lines(), rail_stations(), rail_times(), station_info()

Examples

Run this code
if (FALSE) {
rail_path("A01", "A08")
}

Run the code above in your browser using DataLab