Click the Original, Code and Reconstruction tabs to read about the issues and how they were fixed.
Objective Part I – Choose your data visualisation The main aim of the given visualisation is to deliver the audience about the global GDP of different countries in the year 2017 given by world bank.
Part II – Deconstruct The objective of this visualisation is to talk about the contributions of GDP for the year 2017 of different countries globally in accordance with continents.Hence,the visualisation is created in that manner but its very hard to interpret the some countries which had contributed minimal GDP and its even harder to compare among different countries GDP’s.Along with that the visualisation intended to give us the view of GDP in continent point of view is very hard to intrepret making the visualisation complex.
These are three major issues with the given visualisation
1-Major isssue is using the Pie chart when we are dealing with large numbers of categorical values which made visualisation complex.
2-Its very hard to intrepret the values of countries which contributed minimal GDP.
3-Lastly,eventhough continents are sepreated using different colour codings its hard to understand.
Reference
The following code was used to fix the issues identified in the original.
#Loading the required packages:
library(knitr)
library(dplyr)
library(stringr)
library(ggplot2)
#Reading the data:
#setwd("E:/")
data1<-read.csv("E://Global_GDP.csv")
#Omitting NA's
data1<-na.omit(data1)
#summary(data1)
#Converting torequired datatypes
data1<-data1%>%mutate(GDP=str_replace(GDP, "\\,",""))
data1<-data1%>%mutate(GDP=str_replace(GDP, "\\,",""))
data1$GDP<-as.double(data1$GDP)
#Getting Continents from Country names
library(countrycode)
data1$continets<-countrycode(sourcevar = data1$Economy, origin = "country.name",destination = "region")
#Groupping based on Continents
Continent<- data1 %>% group_by (continets) %>% summarise(GDP=sum(GDP))
Data Reference
Part III – Reconstruct Here,we had used ggplot inorder to construct a bar graph which represents countries name on the X-ais and GDP in percentages on Y-axis.Differnt colours are used to differentiate the countries belonging to different continents using legend.
For the continent wise GDP contribution,we had developed the pie chart with different colour codings.
The following plot fixes the main issues in the original.