Data <- read.table(file.choose(), header = TRUE, sep = "\t")
Data
##                     Provinsi Jumlah_Kecamatan
## 1                       Aceh              290
## 2             Sumatera Utara              455
## 3             Sumatera Barat              179
## 4                       Riau              172
## 5                      Jambi              144
## 6           Sumatera Selatan              241
## 7                   Bengkulu              129
## 8                    Lampung              229
## 9  Kepulauan Bangka Belitung               47
## 10            Kepulauan Riau               80
## 11               DKI Jakarta               44
## 12                Jawa Barat              627
## 13               Jawa Tengah              576
## 14             DI Yogyakarta               78
## 15                Jawa Timur              666
## 16                    Banten              155
## 17                      Bali               57
## 18       Nusa Tenggara Barat              117
## 19       Nusa Tenggara Timur              315
## 20          Kalimantan Barat              174
## 21         Kalimantan Tengah              136
## 22        Kalimantan Selatan              156
## 23          Kalimantan Timur              105
## 24          Kalimantan Utara               55
## 25            Sulawesi Utara              171
## 26           Sulawesi Tengah              178
## 27          Sulawesi Selatan              313
## 28         Sulawesi Tenggara              221
## 29                 Gorontalo               77
## 30            Sulawesi Barat               69
## 31                    Maluku              120
## 32              Maluku Utara              118
## 33               Papua Barat               91
## 34          Papua Barat Daya              132
## 35                     Papua              106
## 36             Papua Selatan               82
## 37              Papua Tengah              131
## 38          Papua Pegunungan              252
length(Data$Jumlah_Kecamatan)
## [1] 38
mean(Data$Jumlah_Kecamatan)
## [1] 191.7895
median(Data$Jumlah_Kecamatan)
## [1] 140
range(Data$Jumlah_Kecamatan)
## [1]  44 666
max(Data$Jumlah_Kecamatan)-min(Data$Jumlah_Kecamatan)
## [1] 622
max(Data$Jumlah_Kecamatan)
## [1] 666
min(Data$Jumlah_Kecamatan)
## [1] 44
var(Data$Jumlah_Kecamatan)
## [1] 23956.82
sd(Data$Jumlah_Kecamatan)
## [1] 154.7799
quantile(Data$Jumlah_Kecamatan)
##    0%   25%   50%   75%  100% 
##  44.0  94.5 140.0 227.0 666.0
library(ggplot2)

ggplot(Data, aes(x=Jumlah_Kecamatan))+
  geom_histogram(
    binwidth=100,
    boundary=0,
    fill="lavenderblush2",
    color="black"
  ) +
  
  scale_x_continuous(
    breaks=seq(0, 700, by=100),
    limits=c(0, 700)
  ) +
  
  labs(
    title="Jumlah Kecamatan di Indonesia Tahun 2025",
    x="Jumlah Kecamatan",
    y="Freq"
  ) +
  theme_classic() +
  theme(
    axis.text.x=element_text(angle=0, hjust=0.5),
    plot.title=element_text(
      hjust=0.5,
      face="bold"
    )
  )

ggplot(Data, aes(x = "", y = Jumlah_Kecamatan)) +
  geom_boxplot(fill = "orchid1") +
  labs(title = "Box Plot Jumlah Kecamatan di Indonesia Tahun 2025", x = "", y = "Jumlah Kecamatan") +
  theme_minimal() +
  theme(plot.title = element_text(hjust = 0.5, face = "bold"))

library(dplyr)
## Warning: package 'dplyr' was built under R version 4.5.3
## 
## 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)
## Warning: package 'tidyverse' was built under R version 4.5.3
## Warning: package 'tidyr' was built under R version 4.5.3
## Warning: package 'readr' was built under R version 4.5.3
## Warning: package 'purrr' was built under R version 4.5.3
## Warning: package 'forcats' was built under R version 4.5.3
## Warning: package 'lubridate' was built under R version 4.5.3
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ forcats   1.0.1     ✔ stringr   1.5.2
## ✔ lubridate 1.9.5     ✔ tibble    3.3.0
## ✔ 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 Jumlah_Kecamatan
## 1   Kalimantan Barat              174
## 2  Kalimantan Tengah              136
## 3 Kalimantan Selatan              156
## 4   Kalimantan Timur              105
## 5   Kalimantan Utara               55
ggplot(Data_Kalimantan, aes(x = Provinsi, y = Jumlah_Kecamatan, fill = Provinsi)) +
  geom_col() +
  labs(
    title = "Jumlah Kecamatan Pulau Kalimantan Tahun 2025", 
    x = "Provinsi",
    y = "Jumlah Kecamatan"
  ) +
  theme_minimal() +
  theme(
    axis.text.x = element_text(angle = 45, hjust = 1),
    plot.title = element_text(hjust = 0.5, face = "bold"),
    legend.position = "none"
  )