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

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

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

Value

A data frame of stations on rail path.

Details

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

Examples

if (FALSE) {
rail_path("A01", "A08")
}