Click the Original, Code and Reconstruction tabs to read about the issues and how they were fixed.
Objective
The visualisation chosen had the following three main issues:
Reference
The following code was used to fix the issues identified in the original.
library(ggplot2)
library(readr)
library(magrittr)
library(tidyr)
my_data <- read_csv("ass2.csv")
df_wide <- my_data %>% pivot_longer(c(year2020, year2019), names_to = "year", values_to = "Income")
plot_household <- ggplot(df_wide, aes(x = Income, y = HIP, color = year)) + geom_line()
Data Reference
The following plot fixes the main issues in the original.