Click the Original, Code and Reconstruction tabs to read about the issues and how they were fixed.
Objective
The objective of the Data Visualization is to compare the co2 emissions from different types of protein, with the objective of showing people which forms of protein have a greater impact on the environment, and how we can reduce our greenhouse gas emissions through the type of protein we eat.
This visualization is targeted towards people who perhaps don’t consider the side effects of the protein they eat in relation to greenhouse gas emissions and global warning, or people whom simply don’t understand how impactful that choice is on the environment.
The visualization chosen had the following three main issues:
Reference
The following code was used to fix the issues identified in the original.
library(ggplot2)
#Loading Raw Data into R
Gas = read.csv("CO2Data.csv")
Green = Gas[ ,c(1,12)]
Green.1 = Green[2:45,]
names(Green.1) = Green.1[1,]
Green.1 = Green.1[-1,]
Green.4 = Green.1[c(11,12,15,34,35,36,37,38,40,41,42,43),]
# Converting Data into Numeric Values
mdd = Green.4$Median
Med.F = as.numeric(mdd)
Median.t = Med.F
#Renaming Character Values
Product = c("Peas","Nuts","Tofu","Beef (Beef Herd)","Beef (Dairy Herd)","Lamb",
"Pork","Chicken","Cheese","Eggs","Fish (Farmed)","Shrimp")
GHG = data.frame(Product,Median.t)
# Reproducing the Visulization
q = ggplot(data = GHG, aes(x = Median.t, y=reorder(Product,Median.t), fill = Product)) +
geom_bar(stat = "identity",width = 0.75) +
theme_bw() +
theme(legend.position = "none") +
scale_fill_manual(values = c("darkviolet","darkviolet","goldenrod1","hotpink2","hotpink2","blue4","darkgray",
"lightsalmon4","darkgreen","hotpink2","dodgerblue3","coral1"))+
labs(title = "How Different Protein Rich Foods Impact the Enviroment",
subtitle = "A look into the median amount of greenhouse gases emitted by
differnt types of protein per 100 grams of protein produced.", caption = "Data taken from
https://science.sciencemag.org/content/360/6392/987/tab-figures-data") +
xlab("Median Greenhouse Gas Emissons per 100g of Product Produced in kgCO2/NU") +
ylab("Type of Protein") +
geom_text(aes(label=Median.t),hjust = -0.4, size = 3.5) +
theme(plot.margin = unit(c(1,1,1,1),"cm"))
Data Reference
The following plot fixes the main issues in the original.