Original


Source: data_n_stuff, 2020, Reddit, Link: https://www.reddit.com/r/dataisbeautiful/comments/iwk1ln/average_yearly_pure_alcohol_consumption_per/


Objective

The objective of the data visualisation is to show the differences in alcohol consumption in European countries. The target audience for this visualisation would be alcohol producers, sellers, and people working in the health industry who may be researching alcohol consumption.

The visualisation chosen had the following three main issues:

References

Code

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

library (dplyr)
library (tidyr)
library(ggplot2)
library(extrafont)



All <- read.csv("All.csv",skip = 25)
head(All)
##   COUNTRY COUNTRY_GRP SEX YEAR VALUE
## 1     ALB             ALL 1962  1.17
## 2     ALB             ALL 1963  0.91
## 3     ALB             ALL 1964  1.04
## 4     ALB             ALL 1965  1.04
## 5     ALB             ALL 1966  1.03
## 6     ALB             ALL 1967  1.17
Beer <- read.csv("Beer.csv",skip = 25)
head(All)
##   COUNTRY COUNTRY_GRP SEX YEAR VALUE
## 1     ALB             ALL 1962  1.17
## 2     ALB             ALL 1963  0.91
## 3     ALB             ALL 1964  1.04
## 4     ALB             ALL 1965  1.04
## 5     ALB             ALL 1966  1.03
## 6     ALB             ALL 1967  1.17
Spirits <- read.csv("Spirits.csv",skip = 25)
head(All)
##   COUNTRY COUNTRY_GRP SEX YEAR VALUE
## 1     ALB             ALL 1962  1.17
## 2     ALB             ALL 1963  0.91
## 3     ALB             ALL 1964  1.04
## 4     ALB             ALL 1965  1.04
## 5     ALB             ALL 1966  1.03
## 6     ALB             ALL 1967  1.17
Wine <- read.csv("Wine.csv",skip = 25)
head(All)
##   COUNTRY COUNTRY_GRP SEX YEAR VALUE
## 1     ALB             ALL 1962  1.17
## 2     ALB             ALL 1963  0.91
## 3     ALB             ALL 1964  1.04
## 4     ALB             ALL 1965  1.04
## 5     ALB             ALL 1966  1.03
## 6     ALB             ALL 1967  1.17
A<-All%>% filter(YEAR==2018) %>% arrange(COUNTRY_GRP) 
A['Variable']='Overall'

B<-filter(Beer,YEAR==2018) %>% arrange(COUNTRY_GRP)
B['Variable']='Beer'

W<-filter(Wine,YEAR==2018) %>% arrange(COUNTRY_GRP)
W['Variable']='Wine'

S<-filter(Spirits,YEAR==2018) %>% arrange(COUNTRY_GRP)
S['Variable']='Spirits'

total <- rbind(A,B,W,S)
total$COUNTRY<- paste(total$COUNTRY,total$COUNTRY_GRP)
names(total)[1] <- "Country"
total<-total[-c(2)]
total$Variable<- factor(total$Variable, levels = c("Overall","Beer","Wine","Spirits"),ordered = TRUE)
levels(total$Variable)
## [1] "Overall" "Beer"    "Wine"    "Spirits"
total <- arrange(total,total$VALUE)
total <- arrange(total,total$Variable)
total$Country <- factor(total$Country, levels=unique(total$Country))
levels(total$Country)
##  [1] "TJK "               "TUR "               "UZB "              
##  [4] " CARINFONET"        "AZE "               "ISR "              
##  [7] "TKM "               "KAZ "               "ARM "              
## [10] "MKD "               "KGZ "               "ALB "              
## [13] "BIH "               "UKR "               "GEO "              
## [16] " CIS"               "NOR "               "GRC "              
## [19] "SWE "               "SRB "               "MDA "              
## [22] " NORDIC"            "RUS "               "ISL "              
## [25] " WHO_EURO"          "ITA "               "MLT "              
## [28] " SEEHN"             "NLD "               "FIN "              
## [31] "MNE "               " SMALL"             "DNK "              
## [34] "BEL "               "CHE "               "CYP "              
## [37] "AND "               " EU_BEFORE_MAY2004" "SVN "              
## [40] "GBR "               " EU_MEMBERS"        "BLR "              
## [43] "HRV "               "ROU "               "SVK "              
## [46] "PRT "               "ESP "               "POL "              
## [49] "HUN "               "DEU "               " EU_AFTER_MAY2004" 
## [52] "LUX "               "EST "               "IRL "              
## [55] "FRA "               "BGR "               "LTU "              
## [58] "AUT "               "LVA "               "CZE "
background <- "#EFF1F0"

pal <- c("#00c49a",
         "#f8e16c",
         "#ffc2b4",
         "#a1c6ea"
       
)

vis<- ggplot(data = total, 
            aes(x = Country, y = VALUE, fill = Variable)) +
  geom_bar(stat = "identity") + coord_flip() + labs(x= "Country/Country-Group", y = "Pure Alcohol Consumption (liter per capita)") +
  facet_grid(.~Variable, scales = "fixed")+
  labs(title = "Pure Alcohol Consumption of European Countries and Country-Groups in 2018", 
       caption = "Source: WHO European Health Information Gateway - https://gateway.euro.who.int/en/datasets/european-health-for-all-database/ 
*Country-Groups: WHO European Region (WHO_EURO),Members of the European Union (EU_MEMBERS),Members of the EU before and after May 2004,\nCentral Asian Republics Information Network members (CARINFONET),South-eastern Europe Health Network members (SEEHN),\nNordic countries, Small countries") + theme_gray() + 
   scale_fill_manual(values = pal) +
   theme(plot.background = element_rect(fill = background),
         panel.background = element_rect(fill = background),
         legend.background = element_rect(fill = background),
         text=element_text(family="verdana"),
            axis.title.x = element_blank(),
         axis.title.y = element_blank(),
         legend.title = element_blank(),
         axis.text.y = element_text(size=5),
         plot.title = element_text(size = 10, hjust = 0.5),
         plot.caption = element_text(size = 5)) 

Data Reference

Reconstruction

The following plot fixes the main issues in the original.