Click the Original, Code and Reconstruction tabs to read about the issues and how they were fixed.
Objective
I have taken this chart from a report titled ‘the State of The North 2018’ published by the Institute for Public Policy Research (IPPR) based in Edinburgh in December 2018. The authors of this report are Luke Raikes who is a senior research fellow at IPPR North, Leah Milward was a Q-step intern at IPPR North for the summer of 2018 and Sarah Longlands is director of IPPR North. This is an official report is about reprioritising the northern powerhouse. IPPR, the Institute for Public Policy Research, is the UK’s leading progressive think tank whose purpose is to conduct and promote research into and the education of the targeted readers from the general public, professional and researchers in social science and those who are interested in the development and current situation of the Northern Powerhouse.
In Figure 4.7, the authors want to illustrate that people live longer and will spend more time with health problems, and on average northerner are already in poor health by the time they retire.
The visualisation chosen had the following three main issues:
Reference
The following code was used to fix the issues identified in the original.
getwd()
## [1] "C:/Users/Srikanth/Desktop/Grad certificate in Analytics with RMIT/Data Visualisation/Assignment 2"
library(ggplot2)
df <- data.frame(region=rep(c("North East", "North West", "Yorkshire and Humber","East Midlands","West Midlands","East","London","South East","South West"), each=2),
sex=rep(c("Women", "Men"), 9),
life_expectancy=c(81.8,77.5,
82.2,77.8,
82.6,78.2,
83,78.9,
82.8,78.0,
83.3,80.2,
84,80.2,
83.7,80.3,
83.7,80.1),
healthy_life_expectancy=c(60.6,59.8,
62.1,61.1,
61.6,61.4,
63,63.1,
63.5,62.9,
65.2,65.1,
64.8,63.7,
66.3,66.1,
65,64.9)
)
df$region<-factor(df$region, levels=c("North East", "North West", "Yorkshire and Humber","East Midlands","West Midlands","East","London","South East","South West"))
d1<-ggplot(data = df,
aes(x=region)) +
geom_bar(aes(y=healthy_life_expectancy,colour=sex),
stat="identity",
position="dodge",
alpha=1
) +
geom_bar(aes(y=life_expectancy,group=sex, colour=sex),
stat="identity",
position="dodge",
alpha=.4) +
scale_fill_discrete() +
geom_hline(yintercept = 65,color="blue") + coord_cartesian(ylim = c(30,85)) + labs(title="Healthy Life Expectancy by Sex in North of England",y="Life Expectancy (years)", x="Region") +
ggsave("geom_bar_healthy_life_expectancy by sex in North of England.jpg", width = 18, height = 12, units = "cm")
Data Reference
The following plot fixes the main issues in the original.