Click the Original, Code and Reconstruction tabs to read about the issues and how they were fixed.
Objective
Explain the objective of the original data visualisation and the targetted audience.
The objective of this data visualisaton is to show to the audience that the road network changes in different areas and the overall trend over the past several Financial Years from Financial Year 2009 to Financial Year 2018. The targeted audience are the readers of Transurban’s annual report, most likely the shareholders, investors, government staff, consultancies and any interested general public.
The visualisation chosen had the following three main issues:
Reference
The following code was used to fix the issues identified in the original.
library(readr) # useful to import dataset
library(tidyr) # useful to tidy data
library(dplyr) # useful to use %>% pipe operator
library(ggplot2) # useful to plot data visulisation
TUOverview <- read_csv("/Users/zhengdali/Documents/S3 DTVL/TUOverview.csv") # read the file
TUOverview$`Financial Year`<-as.factor(TUOverview$`Financial Year`)
TUOverview$`Average Daily Traffic (thousands)`<-as.numeric(TUOverview$`Average Daily Traffic (thousands)`) #prepare the data for plotting.
p1<-ggplot(TUOverview)+ #plot
geom_line (aes(x=`Financial Year`,y=`Average Daily Traffic (thousands)`,colour=`City`,group=`City`))+ #add lines
geom_point(aes(x=`Financial Year`,y=`Average Daily Traffic (thousands)`,colour=`City`))+ #add point
geom_text(aes(x=`Financial Year`,y=`Average Daily Traffic (thousands)`,label=paste(`Average Daily Traffic (thousands)`),colour=`City`),size=2,hjust=1,vjust=2)+ #add text
scale_color_manual(values = c("khaki4","slateblue","yellowgreen","cadetblue4","dodgerblue4"))+ # assign colour
theme_minimal()+ #make the background clean
labs( title= "Average Daily Traffic in Five Cities ",subtitle="Period: Financial Year 2009 to 2018") #add titles
Data Reference
The following plot fixes the main issues in the original.