Click the Original, Code and Reconstruction tabs to read about the issues and how they were fixed.
Objective
The aim of the data visualisation above is to highlight the impact of weather-related disasters on human life over two decades. The graph was sourced from a report that analysed Hydrological, Climatological and Meteorological events and made recommendations for governments and advisory bodies (CRED & UNISDR, 2015). The target audience for the report and data visualisation is therefore people with a vested interest in environmental governance from said entities.
The visualisation chosen had the following three main issues:
Reference
The following code was used to fix the issues identified in the original.
#Data Preperation
Disasters1 <- read_excel("/Users/jonahhughson/Desktop/University/Data Visualisation/Assignment 2/emdat_1995-2015.xlsx", skip = 6)
Disasters1 <- Disasters1[, c(2, 5, 35, 39)]
Disasters1 <- Disasters1 %>% filter(`Disaster Subgroup` == 'Meteorological' | `Disaster Subgroup` == 'Hydrological' | `Disaster Subgroup` == 'Climatological')
Disasters1$Year = as.numeric(unlist(Disasters1['Year']))
Disasters1[is.na(Disasters1)] <- 0
Sumlist = Disasters1 %>% group_by(Year) %>% summarise(Deaths = sum(`Total Deaths`), Affected = sum(`Total Affected`))
Sumlist$AffectedM = Sumlist$Affected / 1000000
Sumlist$DeathsT = Sumlist$Deaths / 1000
#Deaths Plot
d <- ggplot(data = Sumlist, aes(x = Year, y = DeathsT)) +
theme_light()
d <- d +
geom_line(color = "blue")
d <- d + scale_x_continuous(breaks = c(1995, 1997, 1999, 2001, 2003, 2005, 2007, 2009, 2011, 2013, 2015)) +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
d <- d + scale_y_continuous(breaks= c(0, 25, 50, 75, 100, 125, 150))
d <- d + ggtitle("Number of Deaths (Thousands)") + theme(plot.title = element_text(hjust = -.05, size = 9))
d <- d + labs(y = "")
#Affected Plot
a <- ggplot(data = Sumlist, aes(x = Year, y = AffectedM)) +
theme_light()
a <- a +
geom_line(color = "orange")
a <- a + scale_x_continuous(breaks = c(1995, 1997, 1999, 2001, 2003, 2005, 2007, 2009, 2011, 2013, 2015)) +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
a <- a + scale_y_continuous(breaks = c(0, 100, 200, 300, 400, 500, 600, 700))
a <- a + ggtitle("Number of Affected (Millions)") + theme(plot.title = element_text(hjust = -.05, size = 9))
a <- a + labs(y = "")
Data Reference
The following plot fixes the main issues in the original.
#Final Data Visualisation
FinalPlot <- ggarrange(a, d, ncol = 1, nrow = 2)
annotate_figure(FinalPlot,
top = text_grob("Deaths and Affected Persons From Weather-Related Disasters: 1995-2015", face = "bold", size =11))