Markdown tutorial dapat dilihat pada link berikut https://www.youtube.com/watch?v=K418swtFnik & https://www.youtube.com/watch?v=GJ36zamYVLg
Analisis ini bertujuan untuk mengeksplorasi data jurusan mahasiswa dan memvisualisasikannya dalam berbagai bentuk grafik.
library(tidyverse)
## Warning: package 'tidyverse' was built under R version 4.3.3
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.3 ✔ readr 2.1.4
## ✔ forcats 1.0.0 ✔ stringr 1.5.0
## ✔ ggplot2 3.4.3 ✔ tibble 3.2.1
## ✔ lubridate 1.9.3 ✔ tidyr 1.3.0
## ✔ purrr 1.0.2
## ── 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)
library(dplyr)
# Buat dataset contoh
set.seed(123)
data <- tibble(
Jurusan = rep(c("Informatika", "Statistika", "Ekonomi", "Fisika", "Biologi"), each = 20),
Jumlah = sample(50:200, 100, replace = TRUE),
Nilai = rnorm(100, mean = 75, sd = 10)
)
head(data)
## # A tibble: 6 × 3
## Jurusan Jumlah Nilai
## <chr> <int> <dbl>
## 1 Informatika 63 81.6
## 2 Informatika 99 78.0
## 3 Informatika 167 75.7
## 4 Informatika 92 77.1
## 5 Informatika 63 70.1
## 6 Informatika 167 68.7
# Struktur data
str(data)
## tibble [100 × 3] (S3: tbl_df/tbl/data.frame)
## $ Jurusan: chr [1:100] "Informatika" "Informatika" "Informatika" "Informatika" ...
## $ Jumlah : int [1:100] 63 99 167 92 63 167 139 140 140 141 ...
## $ Nilai : num [1:100] 81.6 78 75.7 77.1 70.1 ...
# Statistik deskriptif
summary(data)
## Jurusan Jumlah Nilai
## Length:100 Min. : 53.0 Min. :50.05
## Class :character 1st Qu.: 89.5 1st Qu.:69.40
## Mode :character Median :126.0 Median :75.22
## Mean :125.1 Mean :75.46
## 3rd Qu.:159.0 3rd Qu.:81.94
## Max. :200.0 Max. :96.96
ggplot(data, aes(x = reorder(Jurusan, -Jumlah), y = Jumlah, fill = Jurusan)) +
geom_bar(stat = "identity") +
coord_flip() +
theme_minimal() +
labs(title = "Jumlah Mahasiswa per Jurusan", x = "Jurusan", y = "Jumlah Mahasiswa")
ggplot(data, aes(x = "", y = Jumlah, fill = Jurusan)) +
geom_bar(width = 1, stat = "identity") +
coord_polar(theta = "y") +
theme_minimal() +
labs(title = "Distribusi Mahasiswa per Jurusan")
Berdasarkan visualisasi yang telah dilakukan, dapat disimpulkan bahwa:
Tulis interpretasi lebih lanjut sesuai hasil analisis.