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

Original


Chart of the day: We’re all spending up on takeaways and dining out, except pensioners,https://www.abc.net.au/news/2018-10-08/chart-of-the-day-food-expenditure/10169022


Objective

Explain the objective of the original data visualisation and the targetted audience.

The visualisation chosen had the following three main issues:

  • The color is too single
  • Can’t clearly compare the total amount of items spent in each department
  • The audience looks too complicated

Reference

Code

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

library(readr)
library(ggplot2)
library(gcookbook)
food <- read_csv("C:/Users/Tom/Desktop/data-nGj9t.csv")
## Parsed with column specification:
## cols(
##   Title = col_character(),
##   Item = col_character(),
##   Spend = col_double()
## )
View(food)
str(food)
## Classes 'spec_tbl_df', 'tbl_df', 'tbl' and 'data.frame': 32 obs. of  3 variables:
##  $ Title: chr  "Government pensions and allowances" "Government pensions and allowances" "Government pensions and allowances" "Government pensions and allowances" ...
##  $ Item : chr  "Meals out & fast foods" "Meat, fish & seafood" "Fruit & vegetables" "Condiments, confectionery etc" ...
##  $ Spend: num  679 595 550 480 377 ...
##  - attr(*, "spec")=
##   .. cols(
##   ..   Title = col_character(),
##   ..   Item = col_character(),
##   ..   Spend = col_double()
##   .. )
ggplot(food,aes(x=Item, y=Spend, fill=Title))+geom_bar(stat='identity',position="dodge")

ggplot(food,aes(x=Item, y=Spend, fill=Title))+geom_bar(stat='identity')

Data Reference

Reconstruction

The following plot fixes the main issues in the original.