library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.5.3
Data <- read.table(file.choose(), header = TRUE, sep = "\t")
Data$Penghunian <- as.numeric(Data$Penghunian)
Data_Provinsi <- subset(Data, Provinsi != "INDONESIA")
ggplot(Data_Provinsi, aes(x = Penghunian)) +
geom_histogram(
binwidth = 5,
boundary = 25,
fill = "peachpuff",
color = "black"
) +
scale_x_continuous(
breaks = seq(25, 65, by = 5),
limits = c(25, 65)
) +
labs(
title = "Tingkat Penghunian Kamar pada Hotel Bintang Menurut Provinsi 2025",
x = "Penghunian Kamar",
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_Provinsi, aes(x = "", y = Penghunian)) +
geom_boxplot(fill = "bisque3") +
labs(
title = "Box Plot Tingkat Penghunian Kamar pada
Hotel Bintang Menurut Provinsi 2025",
x = "",
y = "Penghunian Kamar"
) +
theme_minimal() +
theme(
plot.title = element_text(
hjust = 0.5,
face = "bold"
)
)

#
#kalimantan
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
## ── 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
library(ggplot2)
Data_Kalimantan <- Data %>%
filter(str_starts(Provinsi, "KALIMANTAN"))
Data_Kalimantan
## Provinsi Penghunian
## 1 KALIMANTAN_BARAT 50.03
## 2 KALIMANTAN_TENGAH 47.59
## 3 KALIMANTAN_SELATAN 52.80
## 4 KALIMANTAN_TIMUR 53.25
## 5 KALIMANTAN_UTARA 46.15
ggplot(Data_Kalimantan,
aes(x = Provinsi, y = Penghunian, fill = Provinsi)) +
geom_col() +
labs(
title = "Tingkat Penghunian Kamar pada
Hotel Bintang Menurut Provinsi Kalimantan 2025",
x = "Provinsi",
y = "Penghunian Kamar"
) +
theme_minimal() +
theme(
axis.text.x = element_text(
angle = 45,
hjust = 1
),
plot.title = element_text(
hjust = 0.5,
face = "bold"
),
legend.position = "none"
)
