Bus_TravelTime: Retrieve the travel time of each bus routes

Bus_TravelTimeR Documentation

Retrieve the travel time of each bus routes

Description

The function is used to download the travel time of any two adjacent stops for a specific route. It supports to download data of city buses and intercity buses. Note that the function can retrieve the travel time data of single or mutiple bus routes.

Usage

Bus_TravelTime(access_token, county, routeid, 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.

routeid

The specific RouteID that should be retrive for its travel time. This can be a character or a vector. Please ensure that the RouteID must contain in the county; otherwise, it would retrieve nothing.

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.

RouteID This is the main key of this table.
SubRouteID There might exists two or more SubRouteID due to the different direction of sub-route.
Weekday Marked 0 to 6. "0" represents "Sunday".
StartHour The start hour of the travel time data.
EndHour The end hour of the travel time data. Note that the data is recorded meticulously with one hour interval in some counties (e.g.,Taipei), while most of data is recoreded in a longer interval, that is, the difference between StartHour and EndHour is usually larger than 1.
RunTime The operation time under a specific time interval (StartHour~EndHour) of a specific sub-route."

Codes of Direction are listed below.

0 outbound
1 inbound
2 loop
255 unknown

Author(s)

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

Examples

# routeid can be a character
Bus_TravelTime(access_token, "Taipei", "10132")

# routeid can also be a vector
Bus_TravelTime(access_token, "Taipei", c("10132", "10142"))

# routeid can be retrieve from the function Bus_Route()
temp=Bus_Route(access_token, "Hsinchu")
Bus_TravelTime(access_token, "Hsinchu", unique(temp$RouteID), out="./Hsinchu_TravelTime.csv")

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