Data
length(Data$IPM)
mean(Data$IPM)
median(Data$IPM)
range(Data$IPM)
max(Data$IPM)-min(Data$IPM)
max(Data$IPM)
min(Data$IPM)
var(Data$IPM)
sd(Data$IPM)
quantile(Data$IPM)


library(ggplot2)

ggplot(Data, aes(x = IPM)) +
  geom_histogram(
    binwidth = 5,
    boundary = 60,
    fill = "pink",
    color = "black"
  ) +
  scale_x_continuous(
    breaks = seq(60, 85, by = 5),
    limits = c(60, 85)
  ) +
  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"
    )
  )



ggplot(data, aes(x = "", y = IPM)) +
  geom_boxplot(fill = "red") +
  labs(
    title = "box plot IPM INDONESIA 2024",
    x = "",
    y = "IPM"
  ) +
  theme_minimal() +
  theme(plot.title = element_text(hjust = 0.5, face = "bold"))






library(dplyr)
library(tidyverse)
library(ggplot2)

Data_Kalimantan <- Data %>%
  filter(str_starts(Provinsi, "KALIMANTAN"))

Data_Kalimantan

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"
  )




# Load library
library(ggplot2)
# Baca data
data = read.table(file.choose(), header = T, sep = "\t")
data
# Buat barplot dengan ggplot2
ggplot(data, aes(x = Nama_Produk, y = Penjualan, fill = Kategori)) +
  geom_bar(stat = "identity") +
  labs(
    title = "Jumlah Penjualan Produk Toko MUTIA",
    x = "Produk",
    y = "Jumlah Penjualan"
  ) +
  theme_minimal() +
  theme(
    axis.text.x = element_text(angle = 45, hjust = 1),
    plot.title = element_text(hjust = 0.5, face = "bold")
  )