get_arrivals: get_arrivals

Description Usage Arguments Value Examples

View source: R/get_arrivals.R

Description

Function to query data from the CTA arrivals API. The function can give all estimated arrival times by simply calling 'get_arrivals()' or limited estimations by station, route, or a combination of both.

Usage

1
2
get_arrivals(route = NULL, station = NULL, stop = NULL,
  key = Sys.getenv("ctar_api_key"))

Arguments

route

The route or "line" for which you want data. Options are red, blue, brown, pink, green, orange, purple, or yellow. This parameter will match the argument to one of these lines.

station

The station, or parent stop, ID. These uniquely identify a station. Call 'stop_ids()' for reference

stop

The stop ID. These uniquely identify a station and direction. Call 'stop_ids()' for reference

key

The Chicago Transit Authority developer API key either entered as a string or saved to the environment object 'ctar_api_key'

Value

returns a dataframe of locations, estimated arrivals, and reference data.

Examples

1
2
3
4
## Not run: 
get_arrivals(route = "pink", stop = 30132, key = Sys.getenv("ctar_api_key"))

## End(Not run)

willdebras/ctar documentation built on Nov. 5, 2019, 12:20 p.m.