Beberapa library yang perlu diinstall sebagai berikut:
library(ggplot2)
library(readxl)
library(ggthemes)
library(gridExtra)
Data diinput dari Mircosoft Excel dengan syntax sebagai berikut:
setwd("C:/Users/RBNRC/Downloads/Compressed")
data <- read_excel("data_tren_game_engine.xlsx")
head(data)
## # A tibble: 6 × 8
## `Game Engine` `Genre Game` `Tingkat Penggunaan Engine` `Respon Developer`
## <chr> <chr> <chr> <chr>
## 1 Unity Adventure Tinggi Sangat Positif
## 2 Godot Action Tinggi Sangat Positif
## 3 Unity Horror Tinggi Negatif
## 4 Unreal Engine Adventure Tinggi Negatif
## 5 GameMaker RPG Tinggi Sangat Positif
## 6 Unreal Engine Puzzle Rendah Sangat Positif
## # ℹ 4 more variables: `Pengalaman Developer (tahun)` <dbl>,
## # `Frekuensi Penggunaan per Minggu` <dbl>,
## # `Produktivitas Sebelum Engine` <dbl>, `Produktivitas Sesudah Engine` <dbl>
Dari data tersebut akan disajikan visualisasi data dalam bentuk Pie Chart. Berikut terlampir hasil visualisasi data Persentase Responden berdasarkan Game Engine:
pie_chart <- ggplot(data, aes(x = "", fill = `Game Engine`)) +
geom_bar(width = 1) +
coord_polar("y", start = 0) +
theme_minimal() +
labs(title = "Engine") +
theme(axis.text.x = element_blank())
pie_chart
Dari data tersebut akan disajikan visualisasi data dalam bentuk Bar Chart. Berikut terlampir hasil visualisasi data Jumlah Responden berdasarkan Distribusi Tingkat Penggunaan Engine:
bar_chart <- ggplot(data, aes(x = `Tingkat Penggunaan Engine`, fill = `Tingkat Penggunaan Engine`)) +
geom_bar() +
theme_minimal() +
labs(title = "Distribusi Tingkat Penggunaan Engine", x = "Tingkat Penggunaan Engine", y = "Frekuensi")
bar_chart
Dari data tersebut akan disajikan visualisasi data dalam bentuk Dot plot. Berikut terlampir hasil visualisasi data Pengalaman Developer vs. Produktivitas Sebelum Engine:
dot_plot <- ggplot(data, aes(x = `Pengalaman Developer (tahun)`, y = `Produktivitas Sebelum Engine`)) +
geom_point(color = "blue", size = 2) +
theme_minimal() +
labs(title = "Dot Plot: Pengalaman Developer vs. Produktivitas Sebelum Engine", x = "Pengalaman Developer (tahun)", y = "Produktivitas Sebelum Engine")
dot_plot
stem(data$`Pengalaman Developer (tahun)`)
##
## The decimal point is at the |
##
## 1 | 00000
## 2 | 00000
## 3 |
## 4 | 00
## 5 | 0
## 6 | 000000
## 7 | 00
## 8 | 00
## 9 | 00000
## 10 | 00
histogram <- ggplot(data, aes(x = `Frekuensi Penggunaan per Minggu`)) +
geom_histogram(binwidth = 5, fill = "blue", color = "black", alpha = 0.7) +
theme_minimal() +
labs(title = "Histogram: Frekuensi Penggunaan per Minggu", x = "Frekuensi", y = "Jumlah Individu")
histogram
boxplot_data <- ggplot(data) +
geom_boxplot(aes(y = `Pengalaman Developer (tahun)`, fill = "pengalaman developer (tahun"), alpha = 0.6) +
theme_minimal() +
labs(title = "Boxplot: Lama Bekerja dalam tahun", fill = "Kondisi")
boxplot_data
density_plot <- ggplot(data, aes(x = `Produktivitas Sesudah Engine`,fill = "Produktivitas")) +
geom_density(alpha = 0.5) +
theme_minimal() +
labs(title = "Density Plot: Produktivitas Sesudah Engine", x = "Produktivitas", y = "Density")
density_plot
Berikut terlampir syntax untuk menghitung rata-rata (mean) pengalaman developer dari responden
mean(data$`Pengalaman Developer (tahun)`)
## [1] 5.3
Berikut terlampir syntax untuk menghitung median pengalaman developer dari responden
median(data$`Pengalaman Developer (tahun)`)
## [1] 6
Berikut terlampir syntax untuk menghitung modus pengalaman developer dari responden
modus <- function(x) {
uniqx <- unique(x)
uniqx[which.max(tabulate(match(x, uniqx)))]
}
modus(data$`Pengalaman Developer (tahun)`)
## [1] 6
summary(data$`Pengalaman Developer (tahun)`)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 1.0 2.0 6.0 5.3 8.0 10.0
var(data$`Pengalaman Developer (tahun)`)
## [1] 9.872414
sd(data$`Pengalaman Developer (tahun)`)
## [1] 3.14204