Data Table
# Load data
data <- read_excel("GDP_vs_PlasticWaste_Analysis.xlsx")
# Rename columns
colnames(data) <- c("Country", "GDPperCapita", "WastePerCapita", "TotalWaste", "Mismanaged" , "Managed %")
# Show interactive table
datatable(data, options = list(pageLength = 10, scrollX = TRUE), rownames = FALSE)
Interactive Scatterplots
plot_ly(data, x = ~GDPperCapita, y = ~WastePerCapita, type = 'scatter', mode = 'markers',
hovertext = ~Country,
marker = list(color = 'blue', size = 10)) %>%
layout(title = "GDP vs Plastic Waste per Capita",
xaxis = list(title = "GDP per Capita (USD)"),
yaxis = list(title = "Plastic Waste per Capita (kg)"))
plot_ly(data, x = ~GDPperCapita, y = ~TotalWaste, type = 'scatter', mode = 'markers',
hovertext = ~Country,
marker = list(color = 'green', size = 10)) %>%
layout(title = "GDP vs Recycling Rate",
xaxis = list(title = "GDP per Capita (USD)"),
yaxis = list(title = "Recycling Rate (%)"))