Click the Original, Code and Reconstruction tabs to read about the issues and how they were fixed.
Objective
The report is compiled by postnord (Postal company) for European eCommerce & Omni-Channel Trade Association. Their main mission is to promote ECommerce.The Targeted audience are their Association members,Supplier Members, Corporate members and preferred Firms.
The visualisation chosen had the following three main issues:
Reference
The following code was used to fix the issues identified in the original.
library(readr)
library(ggplot2)
products_nordic <- read_csv("products_nordic.csv")
products_nordic$country <- factor(products_nordic$country,levels=c("Nordics","Sweden","Denmark","Norway","Finland"))
products_nordic$products <- factor(products_nordic$products,levels=c("1. Clothing/Shoes","2. Media","3. Home electronics","4. Beauty/Health","5. Furniture/Home decoration","6. Sport/Leisure","7. Groceries","8. Childrens products/Toys"))
p13 <- ggplot(data = products_nordic, aes(x = products_nordic$country, y = products_nordic$Count, fill = products_nordic$country))
p13 + geom_bar(position="dodge",stat = "identity", width=0.9 ) +
facet_wrap( ~ products_nordic$products,nrow=2 ) +
labs(
title = "Product categories people in the Nordic region buy Online (Average per month Januray- December)",
subtitle = "Monthly mean percentage of Total Physical Goods bought online",
caption = "Data source: E-commerce in the Nordics 2018 - PostNord report on Product categories"
) +
geom_text(aes(label= scales::percent(products_nordic$Count/100) ), vjust = -0.5,size = 3,fontface = "bold" ) +
scale_y_continuous(labels = scales::percent) +
scale_fill_manual(values = c("#CDCD00", "#4F94CD","#8B4789","#87CEFF","#27408B" )) +
theme(
legend.position = "top",
panel.grid = element_blank(),
axis.text.y = element_blank(),
axis.text.x = element_blank(),
axis.ticks.y = element_blank(),
axis.ticks.x = element_blank(),
axis.title.x = element_blank(),
axis.title.y = element_blank(),
legend.title = element_blank(),
legend.text = element_text(size=12,face="bold"),
plot.title = element_text(size=13,face="bold",hjust=0),
plot.subtitle = element_text(size=11,face="bold",hjust=0),
plot.caption = element_text(face="italic"),
strip.text.x = element_text(size=12,face="bold"),
plot.margin = margin(2,2,2,2,"cm")
)
Data Reference
The following plot fixes the main issues in the original.