Mohammed Anas Malik Mujahidi (s4228485)==========================================

CHART 1

The Affordability Gap Behind Food Insecurity

==========================================

library(ggplot2) library(dplyr) library(ggrepel)

Create one record per country

chart1 <- food_insecurity_final %>% distinct( Country, Food_Security_Score, Affordability_Score )

Highlight Top 5 and Bottom 5 countries

highlight <- chart1 %>% arrange(desc(Food_Security_Score)) %>% slice(c(1:5, (n()-4):n()))

Create Chart

ggplot( chart1, aes( x = Affordability_Score, y = Food_Security_Score ) ) +

# Scatter Points geom_point( aes(color = Food_Security_Score), size = 4, alpha = 0.85 ) +

# Regression Line geom_smooth( method = “lm”, se = FALSE, color = “#2C3E50”, linewidth = 1.3 ) +

# Important Country Labels geom_text_repel( data = highlight, aes(label = Country), size = 4, fontface = “bold”, box.padding = 0.8, point.padding = 0.8, force = 3, segment.color = “grey50”, max.overlaps = Inf ) +

# Colour Gradient scale_color_gradient( low = “#F39C12”, high = “#1E8449” ) +

labs( title = “The Affordability Gap Behind Food Insecurity”, subtitle = “Affordability appears to be one of the strongest drivers of food security”, x = “Food Affordability Score”, y = “Food Security Score” ) +

theme_minimal(base_size = 14) +

theme( plot.title = element_text( face = “bold”, size = 20 ),

plot.subtitle = element_text(
  size = 12,
  margin = margin(b = 15)
),

axis.title = element_text(
  face = "bold"
),

panel.grid.minor = element_blank(),

legend.position = "none"

)

Final Narrative Question Is food affordability a major factor behind food insecurity? Insight Countries with higher food affordability scores consistently report higher food security scores, indicating that affordability is closely linked to access to nutritious food. Key Message Food insecurity is not only about food availability—it is also about whether people can afford the food that is available. Transition to Chart 2 If affordability influences food security, the next step is to examine food prices and understand why healthy food is becoming harder to afford.

==========================================

CHART 2

Where Is Food the Most Expensive?

==========================================

library(ggplot2) library(dplyr)

chart2 <- food_insecurity_final %>% distinct(Country, Avg_Food_Price) %>% arrange(desc(Avg_Food_Price)) %>% slice(1:10)

ggplot( chart2, aes( x = reorder(Country, Avg_Food_Price), y = Avg_Food_Price ) ) +

geom_col( fill = “#D95F02”, width = 0.7 ) +

coord_flip() +

geom_text( aes(label = round(Avg_Food_Price,1)), hjust = -0.1, size = 4 ) +

labs( title = “Where Is Food the Most Expensive?”, subtitle = “The top 10 countries with the highest average food prices”, x = NULL, y = “Average Food Price” ) +

theme_minimal(base_size = 14) +

theme( plot.title = element_text( face = “bold”, size = 20 ),

plot.subtitle = element_text(
  size = 12
),

panel.grid.minor = element_blank(),

panel.grid.major.y = element_blank()

) +

expand_limits(y = max(chart2$Avg_Food_Price) * 1.15)

Chart 2

Question Where is food the most expensive? Insight A small group of countries experiences substantially higher food prices than others. These higher costs may create additional pressure on household budgets and reduce access to nutritious food. Key Message Rising food costs can make healthy food less affordable and contribute to food insecurity. Transition High food prices alone do not determine food insecurity. The next step is to examine whether people can actually afford healthy food.

Question Can people afford healthy food? Insight Countries classified as higher risk tend to have lower affordability scores. This suggests that access to affordable food is closely linked to overall food insecurity. Key Message Healthy food is not equally affordable for everyone, and affordability challenges are greater in higher-risk settings. Transition When healthy food becomes difficult to afford, people’s eating habits may begin to change.

==========================================

CHART 4

Why Do Eating Habits Change?

==========================================

library(ggplot2) library(dplyr)

chart4 <- food_insecurity_final %>% count( Vegetable_Consumption, Physical_Activity )

ggplot( chart4, aes( x = Vegetable_Consumption, y = n, fill = Physical_Activity ) ) +

geom_col( position = “dodge” ) +

geom_text( aes(label = n), position = position_dodge(0.9), vjust = -0.3, size = 4 ) +

labs( title = “Why Do Eating Habits Change?”, subtitle = “Vegetable consumption differs across physical activity levels”, x = “Vegetable Consumption”, y = “Number of Individuals”, fill = “Physical Activity” ) +

theme_minimal(base_size = 14) +

theme( plot.title = element_text( face = “bold”, size = 20 ),

plot.subtitle = element_text(
  size = 12
),

panel.grid.minor = element_blank()

)

==========================================

CHART 5

Who Faces the Highest Health Risks?

==========================================

library(ggplot2) library(dplyr)

chart5 <- food_insecurity_final %>% count( Age_Group, Gender, Risk_Category )

ggplot( chart5, aes( x = Age_Group, y = n, fill = Risk_Category ) ) +

geom_col( position = position_dodge(width = 0.8), width = 0.65 ) +

facet_grid(. ~ Gender) +

scale_fill_manual( values = c( “High Risk” = “#E76F51”, “Medium Risk” = “#457B9D”, “Low Risk” = “#2A9D8F” ) ) +

labs( title = “Who Faces the Highest Health Risks?”, subtitle = “Food insecurity risk varies across age groups and gender”, x = “Age Group”, y = “Number of Individuals”, fill = “Risk Category” ) +

theme_minimal(base_size = 15) +

theme(

plot.title = element_text(
  face = "bold",
  size = 22
),

plot.subtitle = element_text(
  size = 12,
  margin = margin(b = 15)
),

axis.title = element_text(
  face = "bold",
  size = 14
),

axis.text.x = element_text(
  angle = 25,
  hjust = 1,
  size = 11
),

axis.text.y = element_text(
  size = 11
),

strip.text = element_text(
  face = "bold",
  size = 13
),

panel.grid.minor = element_blank(),

panel.grid.major.x = element_blank(),

legend.position = "right",

legend.title = element_text(
  face = "bold"
)

)