Bus_RealTime: Retrieve the detailed information of each bus route

Bus_RealTimeR Documentation

Retrieve the detailed information of each bus route

Description

The function is used to download the bus route information, including the route name, subroute name, bus route type, direction, departure and destination stop name. Note that it supports to download data of city buses and intercity buses.

Usage

Bus_RealTime(access_token, county, format, dates=F, out=F)

Arguments

access_token

Your access token given by TDX platform. This can be derived from the function get_token().

county

Please fill in the English county name. Checking out the appropriate county name in dataframe TDX_County. If Intercity is used, the function retrieves the intercity bus data.

format

This argument shuld be frequency or stop. The former is the real time data of each vehicle, while the latter is the real time data based on depature and arrial of the bus for each station.

dates

If historical data would be retrieved, this argument should be set; otherwise the default value is FALSE. The date format should be YYYY-MM-DD.

out

If the result should be exported to the local, please fill in the directory. The default value is FALSE, which does not export the data.

Value

Some columns definition are listed below.

RouteUID It contains every subroutes and directions in a same RouteUID.
SubRouteUID If the direction or subroute is not the same, a different SubRouteUID must be recorded.
PlateNumb The plate number of vehicle.

Codes of Direction are listed below.

0 outbound
1 inbound
2 loop
255 unknown

Codes of BusStatus are listed below.

0 normal
1 crash
2 breakdown
3 congestion
4 emergency
5 gas refill
90 unknown
91 unknown direction
98 route offset
99 non-operation status
100 full
101 chartered
255 unknown (due to data loss)

Author(s)

Maintainer: Chia Jung, Yeh chia-jung.yeh@sydney.edu.au

Examples

Bus_RealTime(access_token, "Taipei")
Bus_RealTime(access_token, "Hsinchu", out="./Hsinchu_Bus_Route.csv")

ChiaJung-Yeh/NYCU_TDX documentation built on Aug. 28, 2024, 10:43 p.m.