Click the Original, Code and Reconstruction tabs to read about the issues and how they were fixed.
Objective
The objective here is to visualize the literacy rate across the world. The author had depicted the visualization using a world map by plotting it in a heat map. This visualization was originally posted on our world in as one of a research topic.
The visualisation chosen had the following three main issues:
Reference
Literacy rate by country retreived on 23 Sep 2019 https://ourworldindata.org/grapher/literacy-rate-by-country
The following code was used to fix the issues identified in the original.
library(readr)
literacy_rate_by_country <- read_csv("/Users/vicky/Downloads/literacy-rate-by-country.csv")
View(literacy_rate_by_country)
library(ggplot2)
library(scales)
library(dplyr)
l1 <- literacy_rate_by_country
l1<-filter(literacy_rate_by_country,`Literacy rate (%)`<=50)
p1 <- ggplot(data=l1, aes(x=reorder(Entity, -`Literacy rate (%)`),
y=`Literacy rate (%)`))+ylim(0,65)+
geom_bar(position="dodge",stat="identity", fill = "#FF6666", width=0.45)+ theme_minimal()+
geom_text(aes(label=`Literacy rate (%)`),vjust=-0.5,size=3)+
labs(
title ="Literacy Rate by Country", x = "Countries",
y = "Percentage of Literacy") + theme(axis.text = element_text(angle=45,hjust = 1))
p1
Data Reference
The following plot fixes the main issues in the original.
here we use the ggplot2 to visualize the literacy rates of countries which are below 50%. Since most of the countries are having literacy rates above 90%, these are the countries where the rates are lesser when compared to the other countries and we can infer that the below countries are developing.