Description Usage Arguments Details Value Examples
View source: R/get_train_position.R
This function is one of two that interacts with the Follow the Train API. It provides the location of a single train by its run number.
1 | get_train_position(run_number = NULL, key = Sys.getenv("ctar_api_key"))
|
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' |
This API tends to be finicky and fail. The 'get_arrivals()' function tends to be more precise and can be filtered by run number.
Returns a table of the longitude and latitude of a single train.
1 2 3 4 | ## Not run:
get_train_position(308, key = Sys.getenv("ctar_api_key"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.