Assessment declaration checklist

Please carefully read the statements below and check each box if you agree with the declaration. If you do not check all boxes, your assignment will not be marked. If you make a false declaration on any of these points, you may be investigated for academic misconduct. Students found to have breached academic integrity may receive official warnings and/or serious academic penalties. Please read more about academic integrity here. If you are unsure about any of these points or feel your assessment might breach academic integrity, please contact your course coordinator for support. It is important that you DO NOT submit any assessment until you can complete the declaration truthfully.

By checking the boxes below, I declare the following:

I understand that:

I agree and acknowledge that:

Deconstruct

Original

The original data visualisation selected for the assignment was as follows:


Source: (Ourworldindata, Per capita meat consumption by type 2020).


Objective and Audience

The objective and audience of the original data visualisation chosen can be summarised as follows:

Objective The original visualization aims to compare the per capita meat consumption by type across selected countries in 2020, specifically highlighting the US in context with Italy, Germany, and Japan.

Audience The primary audience includes stakeholders interested in dietary trends such as nutritionists, policy makers, environmentalists, as well as the general public interested in meat consumption patterns.

Critique

The visualisation chosen had the following three main issues:

  • Scaling and Representation: The original visualization’s x-axis is capped at 100 kg/year, which inadequately represents countries like the USA, where meat consumption per capita exceeds this limit. This truncation misleads the interpretation of the data as it visually underrepresents the US consumption relative to other countries.
  • Data Redundancy and Relevance: The inclusion of “Other Meats” and “Sheep/Goat” categories introduces unnecessary complexity without significantly contributing to the analysis of mainstream meat consumption (poultry, beef, pork, seafood), especially in a comparative international context where these categories are minor.
  • Consistency in Comparison: The original visualization includes a diverse set of countries with varying levels of meat consumption, which may dilute the focus from high-consumption contexts necessary for a pointed analysis. Limiting the dataset to top meat-consuming countries (e.g., USA, Australia, Hong Kong) ensures a more consistent and relevant comparison, directly addressing the practical question of how US meat consumption compares to other similarly positioned nations.

Reconstruct

Code

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

rm(list=ls()) # Clean R's memory!

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

# Load and filter data
rawdata <- read.csv("per-capita-meat-type.csv", header = TRUE)
filtered_data <- rawdata %>%
  filter(Entity %in% c("Italy", "Germany", "Hong Kong", "Australia", "United States", "Japan"), Year == 2020)

# Rename columns
names(filtered_data)[1] <- "Country"
names(filtered_data)[4] <- "Poultry"
names(filtered_data)[5] <- "Beef"
names(filtered_data)[7] <- "Pig"
names(filtered_data)[9] <- "Seafood"

# Select and prepare the final dataframe
df1 <- filtered_data %>%
  select(Country, Poultry, Beef, Pig, Seafood) %>%
  mutate(across(c(Poultry, Beef, Pig, Seafood), ~ ceiling(.x)))

# Transform from wide to long
long_data <- df1 %>%
  pivot_longer(cols = -Country, names_to = "MeatType", values_to = "Consumption") %>%
  group_by(Country) %>%
  arrange(Country, desc(MeatType)) %>%
  mutate(LabelPos = cumsum(Consumption) - 0.5 * Consumption)

# Adding country order based on total consumption
long_data$Country <- reorder(long_data$Country, long_data$Consumption, FUN = sum)

# Calculate the total meat consumption for each country and the position for total labels
country_totals <- long_data %>%
  group_by(Country) %>%
  summarize(TotalConsumption = sum(Consumption), .groups = 'drop') %>%
  mutate(Position = TotalConsumption)  # This adds the Position column used for placing the total consumption label

Reconstruction

The following plot fixes the main issues in the original.

# Define custom colors
custom_colors <- c("Seafood" = "navy", "Pig" = "pink", "Beef" = "darkred", "Poultry" = "tan")

# Creating the plot with all adjustments
ggplot(long_data, aes(x = Country, y = Consumption, fill = MeatType)) +
  geom_bar(stat = "identity", position = "stack") +
  geom_text(aes(label = Consumption, y = LabelPos), vjust = 0.5, color = "white", size = 3, fontface = "bold") +
  geom_text(data = country_totals, 
            aes(x = Country, label = TotalConsumption, y = Position), 
            vjust = -0.5, color = "black", size = 3.5,
            inherit.aes = FALSE) +  # Prevent inheriting global aesthetics
  theme_minimal() + 
  scale_fill_manual(values = custom_colors) +
  labs(title = "Per Capita Meat Consumption by Country",
       x = "Country",
       y = "Consumption (kg per year)",
       fill = "Type of Meat") +
  theme_minimal()

References

The reference to the original data visualisation choose, the data source(s) used for the reconstruction and any other sources used for this assignment are as follows: