# Load Excel file
data <- read_excel("GDP_vs_PlasticWaste_Analysis.xlsx")
colnames(data) <- c("Country", "GDP", "Waste", "Recycling")
How does a country’s GDP per capita relate to its per capita plastic waste generation, and do higher-income countries manage waste more sustainably through recycling?
datatable(data, options = list(pageLength = 10, scrollX = TRUE), rownames = FALSE)
ggplot(data, aes(x = GDP, y = Waste, color = Recycling, size = Recycling)) +
geom_point(alpha = 0.7) +
geom_smooth(method = "lm", se = TRUE, color = "darkred", linetype = "dashed") +
scale_color_gradient(low = "blue", high = "orange") +
labs(title = "GDP vs Plastic Waste per Capita",
subtitle = "Point color and size represent recycling rate",
x = "GDP per Capita (USD)",
y = "Plastic Waste per Capita (kg)",
color = "Recycling Rate (%)",
size = "Recycling Rate (%)") +
theme_minimal()
ggplot(data, aes(x = GDP, y = Recycling, label = Country)) +
geom_point(color = "forestgreen", size = 3) +
geom_text(check_overlap = TRUE, vjust = -0.5, size = 3) +
geom_smooth(method = "lm", se = TRUE, color = "black", linetype = "dotted") +
labs(title = "GDP vs Recycling Rate",
subtitle = "Countries with higher GDP tend to recycle more",
x = "GDP per Capita (USD)",
y = "Recycling Rate (%)") +
theme_light()
Based on the plots and data: