# Histogram
Data=read.table(file.choose(),header = T)
Data
##                     Provinsi Miskin
## 1                       ACEH  12.33
## 2             SUMATERA_UTARA   7.36
## 3             SUMATERA_BARAT   5.35
## 4                       RIAU   6.16
## 5                      JAMBI   7.19
## 6           SUMATERA_SELATAN  10.15
## 7                   BENGKULU  12.08
## 8                    LAMPUNG  10.00
## 9  KEPULAUAN_BANGKA_BELITUNG   5.00
## 10            KEPULAUAN_RIAU   4.44
## 11               DKI_JAKARTA   4.28
## 12                JAWA_BARAT   7.02
## 13               JAWA_TENGAH   9.48
## 14             DI_YOGYAKARTA  10.23
## 15                JAWA_TIMUR   9.50
## 16                    BANTEN   5.63
## 17                      BALI   3.72
## 18       NUSA_TENGGARA_BARAT  11.78
## 19       NUSA_TENGGARA_TIMUR  18.60
## 20          KALIMANTAN_BARAT   6.16
## 21         KALIMANTAN_TENGAH   5.19
## 22        KALIMANTAN_SELATAN   3.84
## 23          KALIMANTAN_TIMUR   5.17
## 24          KALIMANTAN_UTARA   5.54
## 25            SULAWESI_UTARA   6.71
## 26           SULAWESI_TENGAH  10.92
## 27          SULAWESI_SELATAN   7.60
## 28         SULAWESI_TENGGARA  10.54
## 29                 GORONTALO  13.24
## 30            SULAWESI_BARAT  10.41
## 31                    MALUKU  15.38
## 32              MALUKU_UTARA   5.81
## 33               PAPUA_BARAT  20.66
## 34          PAPUA_BARAT_DAYA  17.95
## 35                     PAPUA  19.16
## 36             PAPUA_SELATAN  19.71
## 37              PAPUA_TENGAH  28.90
## 38          PAPUA_PEGUNUNGAN  30.03
library(ggplot2)
ggplot(Data, aes(x = Miskin)) +
  geom_histogram(
    binwidth = 5,
    boundary = 0,
    fill = "orange",
    color = "black"
  ) +
  scale_x_continuous(
    breaks = seq(0, 35, by = 5),
    limits = c(0, 35)
  ) +
  labs(
    title = "Persentase Penduduk Miskin di Indonesia tahun 2025",
    x = "Persentase Penduduk Miskin Indonesia Maret 2025",
    y = "Freq"
  ) +
  theme_classic() +
  theme(
    axis.text.x = element_text(angle = 0, hjust = 0.5),
    plot.title = element_text(
      hjust = 0.5,
      face = "bold"
    )
  )

# Boxplot
ggplot(Data, aes(x = "", y = Miskin)) +
  geom_boxplot(fill = "red") +
  labs(title = "Box Plot Persentase Penduduk Miskin Indonesia Maret 2025", x = "", y = "Persentase Penduduk Miskin") +
  theme_minimal() +
  theme(plot.title = element_text(hjust = 0.5, face = "bold"))

library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ forcats   1.0.1     ✔ stringr   1.6.0
## ✔ lubridate 1.9.5     ✔ tibble    3.3.1
## ✔ purrr     1.2.2     ✔ tidyr     1.3.2
## ✔ readr     2.2.0
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(ggplot2)
Data_Kalimantan <- Data %>%
  filter(str_starts(Provinsi, "KALIMANTAN"))
Data_Kalimantan
##             Provinsi Miskin
## 1   KALIMANTAN_BARAT   6.16
## 2  KALIMANTAN_TENGAH   5.19
## 3 KALIMANTAN_SELATAN   3.84
## 4   KALIMANTAN_TIMUR   5.17
## 5   KALIMANTAN_UTARA   5.54
ggplot(Data_Kalimantan, aes(x = Provinsi, y = Miskin, fill = Provinsi)) +
  geom_col() +
  labs(
    title = "Persentase Penduduk Miskin Pulau Kalimantan Maret 2025",
    x = "Provinsi",
    y = "Persentase Penduduk Miskin"
  ) +
  theme_minimal() +
  theme(
    axis.text.x = element_text(angle = 45, hjust = 1),
    plot.title = element_text(hjust = 0.5, face = "bold"),
    legend.position = "none"
  )