Bus_Distance | R Documentation |
The function is used to download the distance 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 data of single or mutiple bus routes.
Bus_Distance(access_token, county, routeid, out=F)
access_token |
Your access token given by TDX platform. This can be derived from the function |
county |
Please fill in the English county name. Checking out the appropriate county name in dataframe |
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. |
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. | |
FromStopID | The origin stops. | |
ToStopID | The destination stops. | |
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. | |
Distance | The distance of each adjacent stops of a specific sub-route." | |
Codes of Direction are listed below.
0 | outbound |
1 | inbound |
2 | loop |
255 | unknown |
Maintainer: Chia Jung, Yeh chia-jung.yeh@sydney.edu.au
# routeid can be a character
Bus_Distance(access_token, "Taipei", "10132")
# routeid can also be a vector
Bus_Distance(access_token, "Taipei", c("10132", "10142"))
# routeid can be retrieve from the function Bus_Route()
temp=Bus_Route(access_token, "Hsinchu")
Bus_Distance(access_token, "Hsinchu", unique(temp$RouteID), out="./Hsinchu_BusDist.csv")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.