title: “Tugas Pendalaman Materi - Indeks Masyarakat Digital Indonesia (IMDI) Menurut Provinsi Tahun 2022”
author: ”
1. Ryo Ananda Nugraha (3337260104),
2. Roofi Muqsith Al yanmi (3337260141),
3. Muhammad Hanif Al Kayyisa (3337260074)”
output: html_document
date: “2026-09-23”

library(readxl)
library(ggplot2)
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
data_excel <- read_excel("Indeks-Masyarakat-Digital-Indonesia-(IMDI)-Menurut-Provinsi-Tahun-2022.xlsx")
top10_data <- read_excel("Indeks-Masyarakat-Digital-Indonesia-(IMDI)-Menurut-Provinsi-Tahun-2022.xlsx") %>%
  arrange(desc(Indeks)) %>%
  head(10)
DT::datatable(data_excel)

2.

ggplot(data = top10_data, mapping = aes(x = reorder(Provinsi, Indeks), y = Indeks)) + 
  geom_col(fill = "#F54927") + 
  
  geom_text(
    aes(label = sprintf("%.2f", Indeks)), 
    hjust = -0.2,                             
    color = "#000",                        
    fontface = "bold",                        
    size = 4
  ) +
  
  coord_flip() +
  
  labs(title ="10 Provinsi dengan IMDI tertinggi",x = NULL, y = "Indeks") +
  
  scale_y_continuous(limits = c(0, max(top10_data$Indeks) * 1.15)) +
  
  theme_minimal() +
  theme(
    axis.text.y = element_text(face = "bold", size = 10),
    panel.grid.major.y = element_blank(),
    panel.grid.minor = element_blank()
  )

visualisi

df_clean <- read_excel("Indeks-Masyarakat-Digital-Indonesia-(IMDI)-Menurut-Provinsi-Tahun-2022.xlsx")

ggplot(df_clean, aes(x = Indeks)) +
  # Garis poligon
  geom_freqpoly(binwidth = 3, color = "#F54927", linewidth = 1) +
  # Titik-titik pada tiap bin/interval
  geom_point(stat = "bin", binwidth = 3, color = "#F54927", size = 3) +
  
  theme_minimal() +
  labs(
    title = "Poligon Frekuensi Indeks Masyarakat Digital Indonesia (IMDI) Tahun 2022",
    x = "Indeks IMDI",
    y = "Frekuensi (Jumlah Provinsi)"
  ) +
  theme(
    plot.title = element_text(face = "bold", size = 12),
    axis.title = element_text(face = "bold"),
    panel.grid.minor = element_blank()
  )

R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

summary(cars){r load_libraries} library(readxl) library(ggplot2) library(dplyr)

Including Plots

You can also embed plots, for example:

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.