LA-01

Question

Create a radial bar chart to show top 10 cities with highest air pollution levels

Step1:Dataset that is provided here

# Simulated top 10 polluted cities and their AQI
top10 <- data.frame(
  City = c( "Kinshasa", "Dhaka" , "Delhi", "Lahore", "Medan", "Batam", "Kolkata","Karachi", "Wuhan", "Beijing"),
  AQI = c(205,171 ,159, 162, 156, 138, 153, 220, 128, 129)
)

Step 2: Load the libraries

# Load necessary libraries
library(ggplot2)
library(forcats)
library(RColorBrewer)

Step 3: Put in a order

# Reorder cities by AQI for better radial display
top10$City <- fct_reorder(top10$City, top10$AQI)

Step 4: Using ggplot2 , graph presents

# Create radial bar chart
ggplot(top10, aes(x = City, y = AQI, fill = City)) +
  geom_bar(stat = "identity", show.legend = FALSE) +
  coord_polar(start = 0) +
  scale_fill_brewer(palette = "Set3") +
  theme_minimal() +
  labs(
    title = "Top 10 Most Polluted Cities (Simulated AQI)",
    subtitle = "Static example using hardcoded data",
    x = NULL,
    y = NULL
  ) +
  theme(
    axis.text.x = element_text(angle = 90, vjust = 0.5, size = 10),
    plot.title = element_text(size = 16, face = "bold"),
    plot.subtitle = element_text(size = 12),
    panel.grid = element_blank()
  )