Click the Original, Code and Reconstruction tabs to read about the issues and how they were fixed.

Original


Source:Reddit DataIsUgly Section(2020). Based on OECD data


Objective

The objective of this visualisation is to visualise the current account balance of each country. A country’s account balance is usually calculated to gauge the current account deficit or surplus. It is calculated by finding the difference between the country’s imports and exports and adding the income generated abroad and the net current transfers.

Current account balance -> (Exports of goods and services−Imports of goods and services) + (Net income abroad+Net current transfers)

Countries with a significant surplus are likely to have an abundance of natural resources that are potentially shipping these off to other countries, thus maintaining a rest, whereas the countries with a deficit are the ones processing these resources while running on debt, also known as financing a deficit. This data aims to see if a country is a debtor or a creditor as a whole. It also helps to keep the difference between the exports and imports in check. Economists and Financial Reporters would be the primary targeted audience for this data visualisation. And those parties who are interested to know if a country is a creditor or a debtor.

The visualisation chosen had the following three main issues:

  • 3D-Graph: The 3d-Visualization looks cluttered. It is hard to understand how much each country in the graph accounts for their corresponding current account balance. For example, if we look at Austria’s data, the data is almost hidden behind other countries. Due to this, we cannot see Austria’s data between the years 1998 and 2004. Due to this, the audience may map the current account balance for each country wrong.

  • Problems with axis: There is no title for the visualisation, no label for the x-axis, and challenging to map the data’s change for each year. Example1: there is no title As there is no title, it is hard for an audience to understand the motive of this visualisation. Example2: Mapping the year and current balance account for each data point is hard. If we want to see Italy’s data in the year 2004, it is hard to find and map the data point to its corresponding current account balance. If we need to make a visualisation self-explanatory, we need to add all these details.

  • Issues with data integrity: There is insufficient data that is visualised. As we aim to see if a country is a debtor or a creditor and their current account balance, it would make much more sense to see the country’s import and export data as well, with this we can present the data in a much more efficient way. It would be interesting to see if a country exports more good than imports or vice-verse. Mapping the import and export of goods and services data would give much more depth to the analysis as the audience can compare the difference between them.

Reference

Code

The following code was used to fix the issues identified in the original.

library(readr)
library(dplyr)
library(ggplot2)
library(scales)

getwd()
## [1] "/Users/nikhitasingh/Documents/Second Semester Subjects/Data Visualisation/Assignment 2/assignment2template1950"
setwd(
  "/Users/nikhitasingh/Documents/Second Semester Subjects/Data Visualisation/Assignment 2"
)

#pre-processed the data in excel

#read the pre-processed data
Current_Account_Balance <- read_csv("Current Account Balance.csv")




p = Current_Account_Balance %>% ggplot() +
  geom_line(aes(x = Year, y = `Current account balance in EUR`,
                color = "white"), #Line for Current Account Balance
            lwd = 0.5) +
  geom_line(aes(x = Year, y = `Exports of goods and services, volume in EUR`,
                color = "red")) + #Line for Exports of goods and services
  geom_line(aes(x = Year, y = `Imports of goods and services, volume in EUR`,
                color = "blue")) + #Line for Imports of goods and services
  labs(
    title = "Current Account Balance, Import and Export of goods and services \n For Europeon Countries in EUR",
    x = "Year",
    y = "Billions in EUR",
    caption = "Source: Alena Voru. (2020). *World Economic Indiactors by OECD*. Retrieved September 13, 2020, \n from Kaggle Website: https://www.kaggle.com/alenavorushilova/world-economic-indiactors-by-oecd" #Data downloaded from this link
  ) + facet_wrap(~ Country,
                 ncol = 5, #5 facets in each row
                 strip.position = "top", 
                 scales = "free_y") + #scale is assigned as free, as we can clearly see how much does each country accounts for
scale_y_continuous(labels = unit_format(unit = "B", scale = 1e-9)) + #changing the y axis to show in Billion
  scale_color_identity(
    name = '',
    breaks =
      c("white", "red", "blue"), #Adding legend
    labels =
      c(
        "Current account balance in EUR",
        "Exports of goods and services in EUR",
        "Imports of goods and services in EUR"
      ),
    guide = "legend"
  ) +
  theme_dark() #dark background


#Altering the size, position of title, caption, axis labels
theme <- theme(
  legend.position = "bottom",
  legend.direction = "horizontal",
  plot.caption = element_text(color = "black", face = "italic",size=9),
  legend.text = element_text(color = "black", size = 14),
  title = element_text(
    size = 16,
    colour = "black",
    face = "bold"
  ),
  axis.title.x = element_text(size = 14,
                              colour = "black"),
  axis.text.x = element_text(
    size = 11,
    colour = "black",
    angle = 90
  ),
  axis.text.y = element_text(size = 11, colour = "black"),
  axis.title.y = element_text(size = 14,
                              colour = "black"),
  strip.text = element_text(
    size = 14,
    colour = "white",
    face = "bold"
  )
  
)

Data Reference

Reconstruction

The following plot fixes the main issues in the original.