I will be deconstructing and reconstructing the following visualisation.
Taken from: Meat Atlas, A report from Friends of the Earth Europe
From the title, I believe it was meant to show the quantity, the type and where meat was produced around the world. However, the data presented consists of production quantities from 26 countries. No further information was provided on why these 26 countries were selected and how it ties back to meat production of the world. The data also mentioned that figures presented were an average of production quantities of years 2010-2012 with no explanation on why average was taken. In terms of visualisation, some bar charts exceeded the chart area and were truncated. Some bar charts were also not accurately placed in the geographical location of the country which can be misleading as well. In my opinion, the key storyline behind the visualisation is to show 1) which type of meat have the highest production quantity and 2) a broad overview of the quantities of the meat produced around the world.
## read in the production statistics
data<- read.csv("Production_LivestockPrimary_E_All_Data.csv",
header=TRUE)
## read in the countrygroup data to map country to region
countrygroup<- read.csv("FAOSTAT_data_8-5-2017.csv",
header=TRUE)
countrygroup <- countrygroup[,c("Country.Group.Code",
"Country.Group",
"Country.Code",
"Country")]
names(countrygroup) <- c("Country.Group.Code",
"Country.Group",
"Country.Code",
"Area")
## to prep the data into a format for visualisation
dataSelected <- data[,c("Area.Code",
"Area",
"Item.Code",
"Item",
"Element",
"Unit",
"Y2011",
"Y2011F",
"Y2012",
"Y2012F")]
dataSelected <- merge(dataSelected,countrygroup,by=c("Area"))
regions <- c(5100,5200,5300,5400,5500)
dataSelected <- dataSelected[dataSelected$Country.Group.Code %in% regions,]
meatcategories <- c("Meat, Poultry",
"Beef and Buffalo Meat",
"Sheep and Goat Meat",
"Meat, pig")
dataSelected <- dataSelected[dataSelected$Item %in% meatcategories,]
dataSelected <- dataSelected[dataSelected$Element=="Production",]
dataSelected <- dataSelected[dataSelected$Unit=="tonnes",]
dataSelected <- dataSelected[!is.na(dataSelected$Y2012),]
dataSelected$Y2012 <- dataSelected$Y2012/(1000000)
dataSelected$Y2012 <- round(dataSelected$Y2012, digits = 2)
## change to the right data class
dataSelected$Item <- as.character(dataSelected$Item)
dataSelected$Item <- as.factor(dataSelected$Item)
dataSelected$Country.Group.Code <- as.character(dataSelected$Country.Group.Code)
dataSelected$Country.Group.Code <- as.factor(dataSelected$Country.Group.Code)
dataSelected$Country.Group <- as.character(dataSelected$Country.Group)
dataSelected$Country.Group <- as.factor(dataSelected$Country.Group)
## reorder the factor labels
df <- as.data.frame(table(dataSelected$Item))
for(i in 1:nrow(df)){
interestedMeatType <- df$Var1[i]
interestedMeatType <- as.character(interestedMeatType)
subset <- dataSelected[dataSelected$Item==interestedMeatType,]
df$totalQuantity[i] <- sum(subset$Y2012)
}
df <- df[order(df$totalQuantity),]
factorLevelsIWant <- factor(df$Var1,levels=df$Var1)
dataSelected$Item <- factor(dataSelected$Item,levels=factorLevelsIWant)
## rename the factor levels
levels(dataSelected$Item) <- c("Sheep/\nGoat","Cattle/\nBaffalo","Poultry","Pig")
dataSelected$Item <- as.factor(dataSelected$Item )
## prepare the data for the bar plot
dataToPlot <- dataSelected %>% group_by(Item) %>%
summarise(Total=sum(Y2012))
dataToPlot <- as.data.frame(dataToPlot)
## the bar plot
p2 <- ggplot(data=dataToPlot, aes(x=Item,y=Total, fill=Item))
p2 <- p2 + geom_bar(stat="identity") + coord_flip() +
labs(title = "Total Meat Produced",
x = "Meat Type",
y = "Total Quantity (million tonnes)")+
theme(plot.title = element_text(hjust = 0.5),legend.position="none")
## the scatter plot
p1 <- ggplot(data=dataSelected, aes(y= Item, x= Country.Group, color=Item))
p1 <- p1 + geom_jitter(alpha=0.7, width = 0.35, height = 0.4, aes(size=Y2012)) +
scale_size_area(max_size=15) +
labs(title = "Meat Produced by Each Country",
y = "Meat Type",
x = "Region",
size = "Produced Quantity \n(million tonnes)",
color = "Meat Type") +
theme(plot.title = element_text(hjust = 0.5),
axis.ticks.y=element_blank(),
axis.text.y = element_blank(),
axis.title.y=element_blank())
##put them together and add labels
grid.arrange(p2,p1,widths=c(1,2),
top=textGrob("Meat Produced in the World in 2012",gp=gpar(fontsize=20)),
bottom= textGrob("Data Source: FAOSTAT, Livestock Primary dataset"))
The reconstructed visualisation aims to present the total quantities of meat produced for each type with a bar chart. The bar chart is one of the most intuitive ways to compare the total quantities produced for each meat type. As I felt that the data was not complete in the orginal visualisation to represent worldwide meat production, I have supplemented the data with the original data from FAO’s livestock primary dataset. Instead of taking the average production quantities over three years, I have chosen to present the data from the latest year (ie. 2012) from the dataset. Due to the number of data points, I have chosen to present the form of a scatter plot. Each data point corresponds to a country’s production for the year for a specific meat type. To facilitate the interpretation of the data, I have grouped the data points by regions and meat type. The clearer storyline I will like to convey is 1) to identify that meat from pigs and poultry was the world’s more produced meat type in 2012 and 2) pork is predominantly produced in Asia, while poultry production is a fairly more distributed across the regions.
Reference to the original visualisation: Taken from: Meat Atlas, A report from Friends of the Earth Europe
Reference to the original data sources: Data used in the original visualisation was a subset of the data from FAO.
Reference to additional data sources: Obtained the full FAO dataset from FAOSTAT website