Collection data from;

https://jakarta.bps.go.id/id/statistics-table/2/MTExIzI=/jumlah-penduduk-provinsi-dki-jakarta-menurut-kelompok-umur-dan-jenis-kelamin.html

Create Data Frame;

Jakarta_population <- data.frame(
  Ages = rep(c("0-4", "5-9", "10-14", "15-19", "20-24", "25-29", "30-34",
               "35-39", "40-44", "45-49", "50-54", "55-59", "60-64", "65+"), 2),
  Gender = rep(c("Male", "Female"), each = 14),
  Population = c(-424465, -410825, -357772, -294139, -225304, -325748,
                 -388746, -384802, -389405, -409188, -423955, -425222, -424379, -429914,
                 409361, 403671, 407784, 421727, 434095, 431768,
                 435443, 424465, 410825, 357772, 294139, 225304, 325748, 388746)
)

Create Data Graph;

library(ggplot2)

ggplot(Jakarta_population, aes(x = Ages, y = Population, fill = Gender)) +
  geom_bar(stat = "identity", position = position_dodge(width = 0.9), width = 0.8) +
  scale_y_continuous(labels = abs, limits = c(-450000, 450000)) +
  coord_flip() +
  labs(title = "POPULATION JAKARTA 2022",
       subtitle = "Source: Central Statistics Agency of Jakarta Province",
       x = "Age",
       y = "Population") +
  scale_fill_manual(values = c("Male" = "blue", "Female" = "red")) +
  theme_bw() +
  theme(plot.title = element_text(face = "bold", hjust = 0.5),
        axis.text.y = element_text(size = 10),
        axis.text.x = element_text(size = 10),
        legend.title = element_text(size = 10),
        legend.text = element_text(size = 10),
        panel.grid.major = element_blank(),
        panel.grid.minor = element_blank()) +
  geom_text(aes(label = abs(Population)), 
            position = position_dodge(width = 0.9), 
            size = 3, 
            hjust = -0.2) 

Interpretation Data ;

The population pyramid graph above illustrates the population distribution in Jakarta in 2022. The 0-4 age group has a larger population compared to several age groups above it. The 30-34 age group has a slightly larger male population (388,746) than the female population (431,768). For the 65+ age group, the male and female populations are relatively balanced with slightly more females.

This population pyramid shows a young population structure, with a wider base in the younger age group (0-19 years) and then starting to narrow in the older age group. This is an indication that Jakarta still has a fairly young population with the potential for a large population in the future.