Description Usage Arguments Details Value Examples
View source: R/get_bus_location.R
get_bus_location() fetches the last location and status for buses currently running.
1 2 | get_bus_location(routes = NULL, vehicle_ids = NULL,
time_resolution = "s", key = Sys.getenv("ctar_api_key"))
|
routes |
A vector of bus routes to query, such as c(8, 12, 49). API limits to 10 at a time. |
vehicle_ids |
A vector of bus routes to query, such as c(4008, 4012, 8049). API limits to 10 at a time. |
time_resolution |
Determines whether to round the last timestamp up to the minute or not. Default "s" uses second level data. Can supply "m" to round up to minute. |
key |
The Chicago Transit Authority developer API key either entered as a string or saved to the environment object 'ctar_api_key' |
The Bus Tracker API allows you to query by the ID of the bus, e.g. 4008, or by the route, e.g. 49.
Returns a dataframe of individual bus statuses and last postition as of the API server time in CDT TZ.
1 2 3 4 | ## Not run:
get_bus_location(routes=c(8, 12, 49), 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.