This makeover is created to visualise the nature of the modes of transport in Singapore from 2012 to 2018. As there are different modes of transport in Singapore, I would like to understand the performance and trends of these transport.
2 graphs were illustrated to show the behaviors of commuters when taking the public transport.
2 more graphs were used to visualise the population and the number of mileage ran by private vehicles.
The average distance traveled per trip by each public transport is represented by line graphs. Each line represent one mode of public transport.
4 pie charts are used to show the average number of riders for each public transport for 2016, the population distribution and the annual mileage ran by different types of private vehicles across the 6 years .
A grouped multi bar chart is created to visualise the annual average mileage ran by different types of private vehicles across the 6 years. This interactive multi bar chart can be converted to stack bar chart to observe the rise and fall of the mileage between years.
While attempting to visualise the dataset, there were several data and design challenges faced.
1. Data Challenges
2. Design Challenge
There were several datasets gathered for private vehicles. However, as they come from different sources, I want to join these datasets together such that it will be easier for me to call out columns of the datasets that I need. To do so, I use the full join function in dplyr to combine the datasets together. This will help us to join the different datasets into one for easy referencing.
After the multi-bar chart is plotted, I tried to knit the R Markdown document to R Pubs. However, I faced the error that says opts_current not found (Refer to Figure 1). Therefore, instead of directly knitting and publishing it to R Pubs, I saved the graph to a html file before inserting a hyperlink in the R Markdown document. To do so, I used the save() function. After which, I pasted the path of the graph that I saved so that it remains interactive and visualisable for users to understand the graph better.
Figure 1. Error message when knitting R Markdown
Figure 3. Proposed Sketch Design with the amended changes
tidyverse is a set of essential packages to install and load core packages within one command.readr is designed to read and import most types of rectangular data (eg: .csv) in an efficient way.plotly is is an R package that is used to create interactive web-based graphs and has ggplotly function which converts ggplot2 figures into Plotly object.dplyr is manipulating the data. It is designed to abstract how data should be stored.readxl is designed to read excel data (data with xlsx).rCharts is used to create a wide range of interactive graphics for graphs.highcharter package allows access to Highcharts JavaScript graphics library. It can be used to create interactive line charts.library(devtools)
packages= c('tidyverse', 'readr', 'plotly', 'dplyr', 'readxl', 'highcharter', 'DT', 'devtools')
install_github("ramnathv/rCharts")
library(rCharts)
for(p in packages){
if(!require(p,character.only = T)){
install.packages(p)
}
library(p,character.only = T)
}
Loading all datasets together before joining/appending some of them together
priv_pop <- read_excel("vehicles information.xlsx")
priv_mileage <- read_excel("vehicles average mileage.xlsx")
pub_trans = read_csv("public transport avg ridership.csv")
priv_veh <- full_join(priv_pop,priv_mileage,by="id")
Run the dataset using the datatable function to display data for Public Transport
datatable(pub_trans)
Run the dataset using the datatable function to display data for Private Vehicles
datatable(priv_veh)
Before I set to plot the interactive pie chart with plot_ly, I will create a new data frame with data.frame() function to rename and reorder the columns.
pubt <- data.frame(
tot = pub_trans$transport,
year = pub_trans$year,
riders = pub_trans$avg_ridership)
Plot an interactive pie chart using plot_ly() function of Plot_ly R. This will allow the users to be able to freely explore the graph.
Two pie charts are create to visualise on the average ridership for the different modes of public transport for year 2015 and 2016. According to the line graph above, there was a dip in the average distance traveled in year 2016 for MRT/LRT. Therefore, I would like to find out about the proportion for the different modes of transport and whether there was an increment in the average ridership from 2015 to 2016.
An interactive line graph was created to visualise the average distance traveled per trip for each mode of transport.
Two pie charts was plotted to show the population distribution proportion from 2012 to 2018. By having the pie chart, we will be able to compare and understand how the annual mileage differ when compared to population distribution.
An interactive multi-bar chart was created to show the annual mileage ran by different vehicles.
Two options are made available on top of the hovering feature - 1. Grouped Bar Chart - Annual mileage ran by 4 different types of private vehicles were visualised into 4 bar graphs for each year. 2. Stacked Bar CHart - 1 combined bar graph is used to represent the total mileage ran for that year
Mileage Across Years by Different Vehicles
Pie Charts, a Multi-Bar Chart and a Line Graph diagram are created to visualise both types of transport - public and private.
From the line graph for the average distance traveled, commuters generally travel more with MRT/LRT than Bus. Since commuters are traveling shorter distances with MRT/LRT and Buses and Taxis have an increasing average distance over time, commuters may have only commuted MRT/LRT or buses when they are traveling to nearby places and may have relied more on Taxis when traveling to further places.
According to the pie chart, bus has a higher proportion (49.2%) for the average annual ridership than MRT/LRT and taxi. Although MRT has a higher average distance traveled per trip, more people travel by buses. This also meant that more commuters travel by buses for short trips and they usually only turn to MRT/LRT for trips of longer distance. But buses are the preferred choice by the majority.
Private vehicles for personal use (i.e. Cars and Motorcycles) stand a larger proportion of the population distribution (81.5% of the population distribution) for private vehicles as compared to private vehicles that are used for commercial purposes. However, the mileage ran by commercialized vehicles takes up 73.5%. This means that more people use private vehicles for commercial purposes rather than for personal use or as a means of transport.
According to the multi bar chart, private cars in general travel the most during year 2012 and the least in 2018. The average annual mileage has been decreasing since 2014 (Select on Stacked to observe the trend of the average mileage).