Instalasi dan Load Library

library(ggplot2)
library(readxl)
library(ggthemes)
library(gridExtra)

Import Data

setwd ("C:/Users/HP-14/Downloads")
data <- read_excel("data_tren_penggunaan_ai.xlsx")
head(data)
## # A tibble: 6 × 8
##   Industri   `Jenis Pekerjaan` `Tingkat Penggunaan AI` `Respon terhadap AI`
##   <chr>      <chr>             <chr>                   <chr>               
## 1 Manufaktur Software Engineer Rendah                  Negatif             
## 2 Keuangan   Analis Keuangan   Tinggi                  Positif             
## 3 Teknologi  Data Scientist    Sedang                  Negatif             
## 4 Teknologi  Dosen             Tinggi                  Positif             
## 5 Teknologi  Analis Keuangan   Rendah                  Positif             
## 6 Pendidikan Analis Keuangan   Sedang                  Positif             
## # ℹ 4 more variables: `Lama Bekerja (tahun)` <dbl>,
## #   `Frekuensi Penggunaan AI per Minggu` <dbl>,
## #   `Efisiensi Kerja Sebelum AI` <dbl>, `Efisiensi Kerja Sesudah AI` <dbl>

Pie Chart: Distribusi Industri

pie_chart <- ggplot(data, aes(x = "", fill = Industri)) +
  geom_bar(width = 1) +
  coord_polar("y", start = 0) +
  theme_minimal() +
  labs(title = "Distribusi Industri") +
  theme(axis.text.x = element_blank())

pie_chart

Bar Chart: Distribusi Tingkat Penggunaan AI

bar_chart <- ggplot(data, aes(x = `Tingkat Penggunaan AI`, fill = `Tingkat Penggunaan AI`)) +
  geom_bar() +
  theme_minimal() +
  labs(title = "Distribusi Penggunaan AI", x = "Tingkat Penggunaan AI", y = "Frekuensi")

bar_chart

Dot Plot: Lama Bekerja dan Efisiensi Sebelum AI

dot_plot <- ggplot(data, aes(x = `Lama Bekerja (tahun)`, y = `Efisiensi Kerja Sebelum AI`)) +
  geom_point(color = "blue", size = 2) +
  theme_minimal() +
  labs(title = "Lama Bekerja vs Efisiensi Sebelum AI", x = "Lama Bekerja (tahun)", y = "Efisiensi Sebelum AI") +
  theme(plot.margin = margin(10, 10, 10, 10))

dot_plot

Stem and Leaf Plot: Lama Bekerja

stem(data$`Lama Bekerja (tahun)`)
## 
##   The decimal point is 1 digit(s) to the right of the |
## 
##   0 | 11123344
##   0 | 5778889
##   1 | 4
##   1 | 7889
##   2 | 011233444
##   2 | 9

Histogram: Frekuensi Penggunaan AI per Minggu

histogram <- ggplot(data, aes(x = `Frekuensi Penggunaan AI per Minggu`)) +
  geom_histogram(binwidth = 5, fill = "blue", color = "black", alpha = 0.7) +
  theme_minimal() +
  labs(title = "Histogram: Penggunaan AI per Minggu", x = "Frekuensi", y = "Jumlah Individu")

histogram

Boxplot: Lama Bekerja dalam Tahun

boxplot_data <- ggplot(data) +
  geom_boxplot(aes(y = `Lama Bekerja (tahun)`, fill = "Lama Bekerja"), alpha = 0.6) +
  theme_minimal() +
  labs(title = "Boxplot: Lama Bekerja", fill = "Kondisi")

boxplot_data

Density Plot: Efisiensi Kerja Sesudah AI

density_plot <- ggplot(data, aes(x = `Efisiensi Kerja Sesudah AI`, fill = "Efisiensi")) +
  geom_density(alpha = 0.5) +
  theme_minimal() +
  labs(title = "Density Plot: Efisiensi Kerja", x = "Efisiensi", y = "Density")

density_plot

Tampilan Keseluruhan Visualisasi Data

grid.arrange(pie_chart, bar_chart, dot_plot, histogram, boxplot_data, density_plot, ncol = 2)