get_train: get_train

Description Usage Arguments Details Value Examples

View source: R/get_train.R

Description

This function is one of two that interacts with the Follow the Train API. It provides data on the future route of a single train.

Usage

1
get_train(run_number = NULL, key = Sys.getenv("ctar_api_key"))

Arguments

run_number

This is a run number associated with a single train. These change daily. 'get_arrivals()' or 'get_locations()' will provide info on run number.

key

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

Details

This API tends to be finicky and fail. The 'get_arrivals()' function tends to be more precise and can be filtered by run number.

Value

Returns a dataframe of future positions and arrival times for a single train.

Examples

1
2
3
4
## Not run: 
get_train(110, key = Sys.getenv("ctar_api_key"))

## End(Not run)

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