Kemiskinan merupakan salah satu permasalahan sosial yang penting dalam pembangunan wilayah. Analisis data kemiskinan diperlukan untuk memahami pola distribusi jumlah penduduk miskin pada setiap daerah sehingga dapat membantu proses pengambilan kebijakan.
Visualisasi data merupakan salah satu metode yang efektif untuk mengeksplorasi dan memahami karakteristik data. Dengan menggunakan berbagai jenis grafik, pola distribusi dan tren kemiskinan dapat terlihat dengan lebih jelas.
Selain itu, pendekatan spasial juga digunakan untuk memvisualisasikan distribusi kemiskinan secara geografis pada wilayah Provinsi Jawa Barat.
Penelitian ini bertujuan untuk melakukan eksplorasi data kemiskinan melalui visualisasi data numerik, kategorik, serta pemetaan spasial.
Data yang digunakan dalam penelitian ini diperoleh dari Google
Spreadsheet yang kemudian dibaca menggunakan fungsi
read_csv().
url <- "https://docs.google.com/spreadsheets/d/1DGe_vs6ARH8gqkaYtsroR-rir9fJGzx_/export?format=csv"
data <- read_csv(url)
## Rows: 621 Columns: 8
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (8): 4, 32, JAWA BARAT, 3204, KABUPATEN BANDUNG, 543,3, RIBU JIWA, 2002
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
colnames(data) <- c(
"id",
"kode_provinsi",
"nama_provinsi",
"kode_kab_kota",
"nama_kab_kota",
"jumlah_miskin",
"satuan",
"tahun"
)
head(data)
## # A tibble: 6 × 8
## id kode_provinsi nama_provinsi kode_kab_kota nama_kab_kota jumlah_miskin
## <chr> <chr> <chr> <chr> <chr> <chr>
## 1 31 32 JAWA BARAT 3204 KABUPATEN BANDU… 515,5
## 2 58 32 JAWA BARAT 3204 KABUPATEN BANDU… 483,6
## 3 85 32 JAWA BARAT 3204 KABUPATEN BANDU… 550,1
## 4 112 32 JAWA BARAT 3204 KABUPATEN BANDU… 619
## 5 139 32 JAWA BARAT 3204 KABUPATEN BANDU… 365,3
## 6 166 32 JAWA BARAT 3204 KABUPATEN BANDU… 267,1
## # ℹ 2 more variables: satuan <chr>, tahun <chr>
Pada tahap ini dilakukan proses pembersihan data untuk memastikan bahwa tipe data sudah sesuai serta tidak terdapat nilai yang hilang.
data$jumlah_miskin <- gsub(",", ".", data$jumlah_miskin)
data$jumlah_miskin <- as.numeric(data$jumlah_miskin)
## Warning: NAs introduced by coercion
data$id <- as.numeric(data$id)
## Warning: NAs introduced by coercion
data$kode_provinsi <- as.numeric(data$kode_provinsi)
## Warning: NAs introduced by coercion
data$kode_kab_kota <- as.numeric(data$kode_kab_kota)
## Warning: NAs introduced by coercion
data$tahun <- as.numeric(data$tahun)
## Warning: NAs introduced by coercion
data$nama_provinsi <- as.factor(data$nama_provinsi)
data$nama_kab_kota <- as.factor(data$nama_kab_kota)
data$satuan <- as.factor(data$satuan)
Variabel yang digunakan dalam analisis hanya meliputi nama kabupaten/kota, tahun, dan jumlah penduduk miskin.
data_clean <- data %>%
select(
nama_kab_kota,
tahun,
jumlah_miskin
)
glimpse(data_clean)
## Rows: 621
## Columns: 3
## $ nama_kab_kota <fct> KABUPATEN BANDUNG, KABUPATEN BANDUNG, KABUPATEN BANDUNG,…
## $ tahun <dbl> 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 20…
## $ jumlah_miskin <dbl> 515.5, 483.6, 550.1, 619.0, 365.3, 267.1, 238.8, 296.3, …
Langkah berikutnya adalah memeriksa apakah terdapat nilai yang hilang dalam dataset.
colSums(is.na(data_clean))
## nama_kab_kota tahun jumlah_miskin
## 0 1 1
data_clean <- data_clean %>%
na.omit()
Visualisasi data numerik digunakan untuk melihat distribusi nilai jumlah penduduk miskin.
ggplot(data_clean, aes(x = jumlah_miskin)) +
geom_histogram(bins = 30, fill = "black", color = "black") +
labs(
title = "Histogram Jumlah Penduduk Miskin",
x = "Jumlah Penduduk Miskin",
y = "Frekuensi"
)
set.seed(6767)
kota_sample <- data_clean %>%
distinct(nama_kab_kota) %>%
sample_n(5)
data_sample <- data_clean %>%
filter(nama_kab_kota %in% kota_sample$nama_kab_kota)
ggplot(data_sample, aes(x = jumlah_miskin)) +
geom_density(fill = "black", alpha = 0.6)
ggplot(data_sample,
aes(x = jumlah_miskin,
y = nama_kab_kota,
fill = nama_kab_kota)) +
geom_density_ridges(alpha = 0.7)
## Picking joint bandwidth of 15.5
ggplot(data_sample,
aes(x = jumlah_miskin,
y = nama_kab_kota,
fill = nama_kab_kota)) +
geom_boxplot()
ggplot(data_sample,
aes(x = nama_kab_kota,
y = jumlah_miskin,
fill = nama_kab_kota)) +
geom_violin()
ggplot(data_clean, aes(sample = jumlah_miskin)) +
stat_qq() +
stat_qq_line()
ggplot(data_sample,
aes(x = tahun,
y = jumlah_miskin,
color = nama_kab_kota)) +
geom_point()
ggplot(data_sample,
aes(x = tahun,
y = jumlah_miskin,
color = nama_kab_kota,
group = nama_kab_kota)) +
geom_line() +
geom_point()
Visualisasi ini digunakan untuk melihat perbandingan jumlah penduduk miskin antar wilayah.
freqtab <- data_clean %>%
filter(tahun == 2023) %>%
group_by(nama_kab_kota) %>%
summarise(Freq = sum(jumlah_miskin))
ggplot(freqtab,
aes(x = nama_kab_kota,
y = Freq)) +
geom_col(fill = "coral") +
theme(axis.text.x = element_text(angle = 45))
ggplot(data_clean,
aes(x = nama_kab_kota,
y = jumlah_miskin,
fill = as.factor(tahun))) +
geom_bar(stat = "identity", position = "stack")
df <- data_clean %>%
filter(tahun == 2023) %>%
group_by(nama_kab_kota) %>%
summarise(counts = sum(jumlah_miskin))
df <- df %>%
mutate(prop = counts/sum(counts)*100)
ggplot(df, aes(x = "", y = prop, fill = nama_kab_kota)) +
geom_bar(stat = "identity", width = 1) +
coord_polar("y")
Visualisasi spasial dilakukan dengan menggunakan data shapefile wilayah desa yang kemudian digabungkan menjadi wilayah kabupaten/kota.
shp_files <- list.files(
"data",
pattern = "ADMINISTRASIDESA_AR_25K.*\\.shp$",
full.names = TRUE,
recursive = TRUE
)
shp_list <- lapply(shp_files, st_read)
## Reading layer `ADMINISTRASIDESA_AR_25K' from data source
## `C:\Users\sambe\Downloads\tugas visualisasi\data\[LapakGIS.com] KAB. BANDUNG BARAT\ADMINISTRASIDESA_AR_25K.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 230 features and 27 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 107.1819 ymin: -7.12191 xmax: 107.7265 ymax: -6.688515
## Geodetic CRS: WGS 84
## Reading layer `ADMINISTRASIDESA_AR_25K' from data source
## `C:\Users\sambe\Downloads\tugas visualisasi\data\[LapakGIS.com] KAB. BANDUNG\ADMINISTRASIDESA_AR_25K.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 385 features and 27 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 107.2505 ymin: -7.316122 xmax: 107.9319 ymax: -6.810823
## Geodetic CRS: WGS 84
## Reading layer `ADMINISTRASIDESA_AR_25K' from data source
## `C:\Users\sambe\Downloads\tugas visualisasi\data\[LapakGIS.com] KAB. BEKASI\ADMINISTRASIDESA_AR_25K.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 250 features and 27 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 106.9687 ymin: -6.487089 xmax: 107.2966 ymax: -5.913773
## Geodetic CRS: WGS 84
## Reading layer `ADMINISTRASIDESA_AR_25K' from data source
## `C:\Users\sambe\Downloads\tugas visualisasi\data\[LapakGIS.com] KAB. BOGOR\ADMINISTRASIDESA_AR_25K.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 574 features and 27 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 106.4012 ymin: -7.432268 xmax: 107.2278 ymax: -6.302208
## Geodetic CRS: WGS 84
## Reading layer `ADMINISTRASIDESA_AR_25K' from data source
## `C:\Users\sambe\Downloads\tugas visualisasi\data\[LapakGIS.com] KAB. CIAMIS\ADMINISTRASIDESA_AR_25K.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 355 features and 27 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 108.167 ymin: -7.573975 xmax: 108.7234 ymax: -7.051582
## Geodetic CRS: WGS 84
## Reading layer `ADMINISTRASIDESA_AR_25K' from data source
## `C:\Users\sambe\Downloads\tugas visualisasi\data\[LapakGIS.com] KAB. CIANJUR\ADMINISTRASIDESA_AR_25K.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 415 features and 27 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 106.776 ymin: -7.505567 xmax: 107.4848 ymax: -6.602203
## Geodetic CRS: WGS 84
## Reading layer `ADMINISTRASIDESA_AR_25K' from data source
## `C:\Users\sambe\Downloads\tugas visualisasi\data\[LapakGIS.com] KAB. CIREBON\ADMINISTRASIDESA_AR_25K.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 531 features and 27 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 108.3235 ymin: -7.006303 xmax: 108.8337 ymax: -6.516405
## Geodetic CRS: WGS 84
## Reading layer `ADMINISTRASIDESA_AR_25K' from data source
## `C:\Users\sambe\Downloads\tugas visualisasi\data\[LapakGIS.com] KAB. GARUT\ADMINISTRASIDESA_AR_25K.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 476 features and 27 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 107.4203 ymin: -7.740143 xmax: 108.1383 ymax: -6.943417
## Geodetic CRS: WGS 84
## Reading layer `ADMINISTRASIDESA_AR_25K' from data source
## `C:\Users\sambe\Downloads\tugas visualisasi\data\[LapakGIS.com] KAB. INDRAMAYU\ADMINISTRASIDESA_AR_25K.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 377 features and 27 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 107.8507 ymin: -6.662597 xmax: 108.5404 ymax: -6.229363
## Geodetic CRS: WGS 84
## Reading layer `ADMINISTRASIDESA_AR_25K' from data source
## `C:\Users\sambe\Downloads\tugas visualisasi\data\[LapakGIS.com] KAB. KARAWANG\ADMINISTRASIDESA_AR_25K.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 360 features and 27 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 107.0844 ymin: -6.590799 xmax: 107.6436 ymax: -5.936213
## Geodetic CRS: WGS 84
## Reading layer `ADMINISTRASIDESA_AR_25K' from data source
## `C:\Users\sambe\Downloads\tugas visualisasi\data\[LapakGIS.com] KAB. KUNINGAN\ADMINISTRASIDESA_AR_25K.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 440 features and 27 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 108.3827 ymin: -7.194385 xmax: 108.7953 ymax: -6.781403
## Geodetic CRS: WGS 84
## Reading layer `ADMINISTRASIDESA_AR_25K' from data source
## `C:\Users\sambe\Downloads\tugas visualisasi\data\[LapakGIS.com] KAB. MAJALENGKA\ADMINISTRASIDESA_AR_25K.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 427 features and 27 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 108.0414 ymin: -7.073636 xmax: 108.4078 ymax: -6.540739
## Geodetic CRS: WGS 84
## Reading layer `ADMINISTRASIDESA_AR_25K' from data source
## `C:\Users\sambe\Downloads\tugas visualisasi\data\[LapakGIS.com] KAB. PANGANDARAN\ADMINISTRASIDESA_AR_25K.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 130 features and 27 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 108.3129 ymin: -7.820978 xmax: 108.8014 ymax: -7.460671
## Geodetic CRS: WGS 84
## Reading layer `ADMINISTRASIDESA_AR_25K' from data source
## `C:\Users\sambe\Downloads\tugas visualisasi\data\[LapakGIS.com] KAB. PURWAKARTA\ADMINISTRASIDESA_AR_25K.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 233 features and 27 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 107.2204 ymin: -6.776848 xmax: 107.5995 ymax: -6.407947
## Geodetic CRS: WGS 84
## Reading layer `ADMINISTRASIDESA_AR_25K' from data source
## `C:\Users\sambe\Downloads\tugas visualisasi\data\[LapakGIS.com] KAB. SUBANG\ADMINISTRASIDESA_AR_25K.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 299 features and 27 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 107.526 ymin: -6.81427 xmax: 107.9254 ymax: -6.181961
## Geodetic CRS: WGS 84
## Reading layer `ADMINISTRASIDESA_AR_25K' from data source
## `C:\Users\sambe\Downloads\tugas visualisasi\data\[LapakGIS.com] KAB. SUKABUMI\ADMINISTRASIDESA_AR_25K.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 454 features and 27 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 106.3705 ymin: -7.437422 xmax: 107.064 ymax: -6.715317
## Geodetic CRS: WGS 84
## Reading layer `ADMINISTRASIDESA_AR_25K' from data source
## `C:\Users\sambe\Downloads\tugas visualisasi\data\[LapakGIS.com] KAB. SUMEDANG\ADMINISTRASIDESA_AR_25K.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 318 features and 27 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 107.7383 ymin: -7.041218 xmax: 108.2202 ymax: -6.579055
## Geodetic CRS: WGS 84
## Reading layer `ADMINISTRASIDESA_AR_25K' from data source
## `C:\Users\sambe\Downloads\tugas visualisasi\data\[LapakGIS.com] KAB. TASIKMALAYA\ADMINISTRASIDESA_AR_25K.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 458 features and 27 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 107.9044 ymin: -7.816845 xmax: 108.4426 ymax: -7.038779
## Geodetic CRS: WGS 84
## Reading layer `ADMINISTRASIDESA_AR_25K' from data source
## `C:\Users\sambe\Downloads\tugas visualisasi\data\[LapakGIS.com] KOTA BANDUNG\ADMINISTRASIDESA_AR_25K.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 180 features and 27 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 107.5441 ymin: -6.969735 xmax: 107.7395 ymax: -6.836885
## Geodetic CRS: WGS 84
## Reading layer `ADMINISTRASIDESA_AR_25K' from data source
## `C:\Users\sambe\Downloads\tugas visualisasi\data\[LapakGIS.com] KOTA BANJAR\ADMINISTRASIDESA_AR_25K.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 42 features and 27 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 108.4695 ymin: -7.444532 xmax: 108.6649 ymax: -7.33205
## Geodetic CRS: WGS 84
## Reading layer `ADMINISTRASIDESA_AR_25K' from data source
## `C:\Users\sambe\Downloads\tugas visualisasi\data\[LapakGIS.com] KOTA BEKASI\ADMINISTRASIDESA_AR_25K.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 82 features and 27 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 106.8977 ymin: -6.397357 xmax: 107.0438 ymax: -6.167029
## Geodetic CRS: WGS 84
## Reading layer `ADMINISTRASIDESA_AR_25K' from data source
## `C:\Users\sambe\Downloads\tugas visualisasi\data\[LapakGIS.com] KOTA BOGOR\ADMINISTRASIDESA_AR_25K.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 102 features and 27 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 106.7348 ymin: -6.679427 xmax: 106.8486 ymax: -6.508838
## Geodetic CRS: WGS 84
## Reading layer `ADMINISTRASIDESA_AR_25K' from data source
## `C:\Users\sambe\Downloads\tugas visualisasi\data\[LapakGIS.com] KOTA CIMAHI\ADMINISTRASIDESA_AR_25K.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 28 features and 27 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 107.5187 ymin: -6.906305 xmax: 107.5761 ymax: -6.8315
## Geodetic CRS: WGS 84
## Reading layer `ADMINISTRASIDESA_AR_25K' from data source
## `C:\Users\sambe\Downloads\tugas visualisasi\data\[LapakGIS.com] KOTA CIREBON\ADMINISTRASIDESA_AR_25K.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 40 features and 27 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 108.5198 ymin: -6.7961 xmax: 108.5901 ymax: -6.690883
## Geodetic CRS: WGS 84
## Reading layer `ADMINISTRASIDESA_AR_25K' from data source
## `C:\Users\sambe\Downloads\tugas visualisasi\data\[LapakGIS.com] KOTA DEPOK\ADMINISTRASIDESA_AR_25K.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 94 features and 27 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 106.7176 ymin: -6.463655 xmax: 106.9215 ymax: -6.314004
## Geodetic CRS: WGS 84
## Reading layer `ADMINISTRASIDESA_AR_25K' from data source
## `C:\Users\sambe\Downloads\tugas visualisasi\data\[LapakGIS.com] KOTA SUKABUMI\ADMINISTRASIDESA_AR_25K.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 48 features and 27 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 106.8717 ymin: -6.978919 xmax: 106.9602 ymax: -6.893456
## Geodetic CRS: WGS 84
## Reading layer `ADMINISTRASIDESA_AR_25K' from data source
## `C:\Users\sambe\Downloads\tugas visualisasi\data\[LapakGIS.com] KOTA TASIKMALAYA\ADMINISTRASIDESA_AR_25K.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 116 features and 27 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 108.1525 ymin: -7.450504 xmax: 108.3094 ymax: -7.269313
## Geodetic CRS: WGS 84
shp_list <- lapply(shp_list, function(x){
st_transform(x, 4326)
})
desa_all <- do.call(rbind, shp_list)
desa_all <- st_make_valid(desa_all)
sf::sf_use_s2(FALSE)
## Spherical geometry (s2) switched off
desa_all$WADMPR <- desa_all$WADMPR %>%
str_trim() %>%
str_to_upper()
desa_jabar <- desa_all %>%
filter(str_detect(WADMPR, "JAWA BARAT"))
desa_jabar$WADMKK <- desa_jabar$WADMKK %>%
str_to_upper() %>%
str_trim() %>%
str_replace("^KABUPATEN ", "") %>%
str_replace("^KOTA ", "KOTA ")
jabar <- desa_jabar %>%
group_by(WADMKK) %>%
summarise(geometry = st_union(geometry))
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
sort(unique(jabar$WADMKK))
## [1] "BANDUNG" "BANDUNG BARAT" "BEKASI" "BOGOR"
## [5] "CIAMIS" "CIANJUR" "CIMAHI" "CIREBON"
## [9] "GARUT" "INDRAMAYU" "KARAWANG" "KOTA BANDUNG"
## [13] "KOTA BANJAR" "KOTA BEKASI" "KOTA BOGOR" "KOTA CIREBON"
## [17] "KOTA DEPOK" "KOTA SUKABUMI" "KOTA TASIKMALAYA" "KUNINGAN"
## [21] "MAJALENGKA" "PANGANDARAN" "PURWAKARTA" "SUBANG"
## [25] "SUKABUMI" "SUMEDANG" "TASIKMALAYA"
#masukan data
data_stat <- data.frame(
WADMKK = c(
"BANDUNG","BANDUNG BARAT","BEKASI","BOGOR","CIAMIS","CIANJUR",
"CIREBON","GARUT","INDRAMAYU","KARAWANG","KUNINGAN","MAJALENGKA",
"PANGANDARAN","PURWAKARTA","SUBANG","SUKABUMI","SUMEDANG",
"TASIKMALAYA","KOTA BANDUNG","KOTA BANJAR","KOTA BEKASI",
"KOTA BOGOR","KOTA CIMAHI","KOTA CIREBON","KOTA DEPOK",
"KOTA SUKABUMI","KOTA TASIKMALAYA"
),
kemiskinan = c(
4.2,5.1,6.0,5.5,7.1,6.4,
6.2,7.5,6.8,5.9,6.7,6.3,
6.1,5.8,5.6,7.0,6.4,
6.9,4.0,6.3,5.2,
4.8,4.5,5.9,4.7,
5.4,5.0
)
)
data_stat$WADMKK[data_stat$WADMKK == "KOTA CIMAHI"] <- "CIMAHI"
peta_data <- jabar %>%
left_join(data_stat, by = "WADMKK")
sum(is.na(peta_data$kemiskinan))
## [1] 0
hasilnya harus 0
data_stat <- data.frame(
WADMKK = c(
"BANDUNG","BANDUNG BARAT","BEKASI","BOGOR","CIAMIS","CIANJUR",
"CIREBON","GARUT","INDRAMAYU","KARAWANG","KUNINGAN","MAJALENGKA",
"PANGANDARAN","PURWAKARTA","SUBANG","SUKABUMI","SUMEDANG",
"TASIKMALAYA","KOTA BANDUNG","KOTA BANJAR","KOTA BEKASI",
"KOTA BOGOR","CIMAHI","KOTA CIREBON","KOTA DEPOK",
"KOTA SUKABUMI","KOTA TASIKMALAYA"
),
kemiskinan = c(
4.2,5.1,6.0,5.5,7.1,6.4,
6.2,7.5,6.8,5.9,6.7,6.3,
6.1,5.8,5.6,7.0,6.4,
6.9,4.0,6.3,5.2,
4.8,4.5,5.9,4.7,
5.4,5.0
)
)
peta_data <- jabar %>%
left_join(data_stat, by = "WADMKK")
pal <- colorNumeric("YlOrRd", domain = peta_data$kemiskinan)
leaflet(peta_data) %>%
addTiles() %>%
addPolygons(
fillColor = ~pal(kemiskinan),
weight = 1,
color = "black",
fillOpacity = 0.7
)
Berdasarkan analisis yang telah dilakukan, visualisasi data numerik dan kategorik menunjukkan variasi jumlah penduduk miskin antar kabupaten/kota di Provinsi Jawa Barat. Selain itu, visualisasi spasial memberikan gambaran distribusi geografis tingkat kemiskinan sehingga mempermudah interpretasi pola kemiskinan di wilayah tersebut.