Train diagram is vital in terms of railway transport. It can be used to check out the safety, efficiency of railway operation. This R code shows how to download the data from the PTX, which is the open data website of public transport information in Taiwan. It is essential to note that we should apply for the members of PTX, amd get the API ID and API key to access the data directly. This code mainly use the package sf, lwgeom, maptools and nngeo to conduct basic geocomputation. Use package dplyr and data.table to tidy the data. Last but not least, use package ggplot and plotly to produce the graph.
chiajung-yeh / train-diagram Goto Github PK
View Code? Open in Web Editor NEWThis R code shows how to plot train diagram mainly by using package sf, lwgeom, dplyr and ggplot.