Click the Original, Code and Reconstruction tabs to read about the issues and how they were fixed.
Source: The Economist Intellignce Unit
Objective
Explain the objective of the original data visualisation and the targetted audience.
The visualisation chosen had the following three main issues:
Reference
The following code was used to fix the issues identified in the original.
library(ggplot2)
demo_index <- data.frame(Year = c("2006", "2007*", "2008", "2009*", "2010",
"2011", "2012", "2013", "2014", "2015",
"2016", "2017", "2018", "2019", "2020"),
index = c(5.51, 5.51, 5.55, 5.50, 5.46,
5.49, 5.52, 5.53, 5.55, 5.55,
5.51, 5.48, 5.48, 5.45, 5.38
)
)
p1 <- ggplot(data = demo_index, aes(group = 1, x = Year,y = index))
p1 <- p1 + geom_line(stat = "identity", colour = "blue") + geom_point(colour = "red") +
geom_text(aes(label = paste(index,"",sep="")),nudge_y = -0.3, nudge_x = .05) +
labs(
title = "Global Democracy Index",
subtitle="Global average of 167 countries, 10 = most democratic",
y = "Index") + theme_minimal() + scale_y_continuous(limits = c(0,6))
Data Reference
The following plot fixes the main issues in the original.
Note
*no data