This document presents a visualization of Indonesia’s population density using provincial population density data and the Indonesia administrative boundary map from GADM.
library(sf)
library(dplyr)
library(ggplot2)
library(viridis)
population_data <- read.csv(
"C:/Users/rayha/Downloads/kepadatan (1).csv",
stringsAsFactors = FALSE
)
head(population_data)
## Region kepadatan
## 1 ACEH 86
## 2 BALI 718
## 3 KEPULAUAN BANGKA BELITUNG 84
## 4 BANTEN 1237
## 5 BENGKULU 94
## 6 GORONTALO 101
# Convert province names to uppercase
population_data$Region <- toupper(population_data$Region)
# Remove spaces to match GADM province names
population_data$Region <- gsub(" ", "", population_data$Region)
# Rename several provinces to match GADM naming
population_data$Region <- recode(
population_data$Region,
"KEPULAUANBANGKABELITUNG" = "BANGKABELITUNG",
"DKIJAKARTA" = "JAKARTARAYA",
"DIYOGYAKARTA" = "YOGYAKARTA"
)
population_data$DensityGroup <- cut(
population_data$kepadatan,
breaks = c(-Inf, 51, 251, 401, Inf),
labels = c(
"Low",
"Moderate",
"High",
"Very High"
)
)
table(population_data$DensityGroup)
##
## Low Moderate High Very High
## 8 17 1 7
indonesia_map <- st_read(
"C:/Users/rayha/Downloads/gadm41_IDN_1.json",
quiet = TRUE
)
indonesia_map$Region <- toupper(as.character(indonesia_map$NAME_1))
# Remove spaces
indonesia_map$Region <- gsub(" ", "", indonesia_map$Region)
# North Kalimantan was established after 2015
indonesia_map <- subset(
indonesia_map,
Region != "KALIMANTANUTARA"
)
merged_map <- left_join(
indonesia_map,
population_data,
by = "Region"
)
sum(is.na(merged_map$DensityGroup))
## [1] 0
merged_map$Region[
is.na(merged_map$DensityGroup)
]
## character(0)
ggplot(merged_map) +
geom_sf(aes(fill = DensityGroup)) +
scale_fill_viridis_d(option = "D") +
labs(
title = "Indonesia Population Density Map (2015)",
fill = "Category"
) +
theme_minimal()
The map classifies Indonesian provinces into four population density categories: Low, Moderate, High, and Very High.
Most provinces located in Kalimantan, Maluku, and Papua fall into the Low population density category, indicating relatively small populations compared with their land area.
Several provinces in Sumatra, Sulawesi, and Nusa Tenggara belong to the Moderate category, while the High category is represented by only a few provinces.
The Very High category is concentrated on Java Island, reflecting its role as Indonesia’s primary center for government, economic activity, education, and industry. Consequently, these provinces have much higher population densities than other regions.
Overall, the map shows that population density in Indonesia is unevenly distributed, with the highest concentration occurring on Java Island and lower densities observed across much of eastern Indonesia.