Click the Original, Code and Reconstruction tabs to read about the issues and how they were fixed.
Objective
The objective here is to analyse the existing visualization on Population having access to safe drinking water around the world. It’s estimated that only 71% of the world population has access to safe drinking water. This means 29% of the world does not have access.
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)
proportion_using_safely_managed_drinking_water <- read_csv("C:/Users/admin/Downloads/proportion-using-safely-managed-drinking-water.csv")
# Libraries
library(ggplot2)
library(scales)
library(dplyr)
library(tidyverse)
library(hrbrthemes)
library(kableExtra)
data_2015 <- proportion_using_safely_managed_drinking_water %>% filter(Year == 2015)
b = colnames(data_2015)
names(data_2015)[names(data_2015) == "Drinking water - Proportion of population using improved water supplies - Safely managed - National - Percent (%)"] <- "Value"
data_2015 <- data_2015 %>% filter(Value < 70)
map <- data_2015 %>%
filter(!is.na(Value)) %>%
arrange(Value) %>%
tail(25) %>%
mutate(Entity=factor(Entity, Entity)) %>%
ggplot( aes(x=Entity, y=Value) ) +
geom_bar(stat="identity",fill="#009E73") +
theme_ipsum() +
theme(
panel.grid.minor.y = element_blank(),
panel.grid.major.y = element_blank(),
legend.position="none"
) +
xlab("Countries") +
ylab("Percentage") +
coord_flip()
Data Reference
The countries with smaller percentage of accessing safe drinking water is plotted here. This will eradicate the problem of selecting the country on the map. One can easily depicts the percentage of access to drinking water by country name juzt by looking at the below plot.