This function fetches position data from the NSW public transport vehicle position API. An API key must be obtained by registering at https://opendata.transport.nsw.gov.au/. The result is parsed with the RProtoBuf package using the Google gtfs-realtime proto. The prototype compiler stuff is initialised at package load. The result can be used to query trip updates as well as extract positions
1 2 | nswVehicles(vehicle_type = c("ferries", "sydneytrains", "buses", "lightrail",
"nswtrains"))
|
RProtoBuf message
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.