Data <- read.csv(file.choose(), header = T)

#boxplot
library(ggplot2)
ggplot(Data,aes(x="",y=IPM))+
  geom_boxplot(fill="purple")+
  labs(title="Box Plot IPM Indonesia", x="", y="IPM")+
  theme_minimal()+
  theme(plot.title=element_text(hjust=0.5, face="bold"))

#histogram
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.5.2
## ✔ lubridate 1.9.4     ✔ tibble    3.3.0
## ✔ purrr     1.1.0     ✔ tidyr     1.3.1
## ✔ readr     2.1.5
## ── 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
ggplot(Data, aes(x = IPM)) +
  geom_histogram(
    binwidth = 5,
    boundary = 50, # Disesuaikan ke 50
    fill = "green",
    color = "black"
  ) +
  scale_x_continuous(
    breaks = seq(50, 90, by = 5), # Menyesuaikan breaks
    limits = c(50, 90)           # Mencakup 54.91 sampai 85.05
  ) +
  labs(
    title = "IPM di Indonesia", 
    x = "IPM",
    y = "Freq"
  ) +
  theme_classic() +
  theme(
    axis.text.x = element_text(angle = 0, hjust = 0.5),
    plot.title = element_text(
      hjust = 0.5,
      face = "bold"
    )
  )

#kalimantan
Data_Kalimantan <- Data %>%
  filter(str_starts(Provinsi, "Kalimantan"))
Data_Kalimantan
##             Provinsi   IPM
## 1   Kalimantan Barat 72.09
## 2  Kalimantan Tengah 74.86
## 3 Kalimantan Selatan 76.10
## 4   Kalimantan Timur 79.39
## 5   Kalimantan Utara 74.04
ggplot(Data_Kalimantan, aes(x = Provinsi, y = IPM, fill = Provinsi)) +
  geom_col() +
  labs(
    title = "IPM Pulau Kalimantan Tahun 2024",
    x = "Provinsi",
    y = "IPM"
  ) +
  theme_minimal() +
  theme(
    axis.text.x = element_text(angle = 45, hjust = 1),
    plot.title = element_text(hjust = 0.5, face = "bold"),
    legend.position = "none"
  )

range(Data$IPM)
## [1] 54.91 85.05