rail_path: Path Between Stations

View source: R/rail-path.R

rail_pathR Documentation

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

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

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.

Details

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

Value

A data frame of stations on rail path.

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

## Not run: 
rail_path("A01", "A08")

## End(Not run)

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