Instituto Federal de Rondônia - IFRO
Campus
Ji-Paraná
Curso de Análise e Desenvolvimento de Sistemas - ADS
Autor: Adrian Henrique Ferreira
Este painel interativo apresenta uma análise exploratória dos dados de League of Legends, utilizando gráficos, medidas estatísticas e visualizações dinâmicas com foco em aprendizado e comparação. Desenvolvido por Adrian Henrique Ferreira como parte do curso de ADS no IFRO.
O conjunto de dados contém campeões do League of Legends com informações como classes, habilidades, estatísticas de batalha e metadados. Fonte: Riot Games API - League of Legends Dataset
Principais categorias de colunas:
Name
,
Class
, Range Type
,
Difficulty
HP Base
,
HP Growth
, Armor Base
,
Armor Growth
, Attack Damage
,
Attack Range
Passive
, Q
,
W
, E
, R
Release Date
,
Champion ID
, etcdf_rangetype <- lol_data %>%
count(rangetype) %>%
mutate(
Percent = n / sum(n) * 100,
Label = paste0(rangetype, "\n", round(Percent, 1), "%")
)
ggplot(df_rangetype, aes(x = "", y = Percent, fill = rangetype)) +
geom_bar(stat = "identity", width = 1, color = "white") +
coord_polar(theta = "y") +
geom_text(aes(label = Label), position = position_stack(vjust = 0.5), color = "white", size = 5, fontface="bold") +
labs(title = "Distribuição do Tipo de Alcance") +
scale_fill_manual(values = c("Melee" = "#28a745", "Ranged" = "#208c3a")) +
theme_void() +
theme(plot.title = element_text(hjust = 0.5, size = 18, color = "#2c3e50", face = "bold"), legend.position = "none")
df_rangetype_table <- df_rangetype %>% select(Tipo = rangetype, Contagem = n, Percentual = Percent)
datatable(df_rangetype_table,
options = list(dom = 't'),
rownames = FALSE,
class = 'cell-border stripe'
) %>% formatRound('Percentual', digits = 2)
classe_counts <- lol_data %>% count(herotype)
ggplot(classe_counts, aes(x = reorder(herotype, -n), y = n, fill = herotype)) +
geom_bar(stat = "identity") +
geom_text(aes(label = n), vjust = -0.5, color = "black") +
labs(
title = "Distribuição de Classes dos Campeões",
x = "Classe",
y = "Número de Campeões"
) +
theme(axis.text.x = element_text(angle = 45, hjust = 1), legend.position = "none") +
scale_fill_brewer(palette = "Set2")
difficulty_counts <- lol_data %>% filter(!is.na(difficulty)) %>% count(difficulty)
ggplot(difficulty_counts, aes(x = difficulty, y = n, fill = difficulty)) +
geom_bar(stat = "identity") +
geom_text(aes(label = n), vjust = -0.5, color="black", fontface="bold") +
labs(
title = "Distribuição por Nível de Dificuldade",
x = "Dificuldade",
y = "Número de Campeões"
) +
scale_fill_brewer(palette = "Greens", direction = 1) +
theme(legend.position = "none")
for (i in 1:length(continuous_vars)) {
var_label <- names(continuous_vars)[i]
var_name <- continuous_vars[[i]]
var_data <- lol_data %>% select(all_of(var_name)) %>% filter(!is.na(.))
p_hist <- ggplot(var_data, aes(x = .data[[var_name]])) +
geom_histogram(aes(y = ..density..), fill = "#5dade2", color = "white", bins = 20) +
geom_density(color = "#1f618d", size = 1.2) +
labs(title = paste("Distribuição de", var_label), x = var_label, y = "Densidade")
cat(paste0("##### ", var_label, "\n\n"))
print(p_hist)
cat("\n\n")
}
## Warning: Using one column matrices in `filter()` was deprecated in dplyr 1.1.0.
## ℹ Please use one dimensional logical vectors instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## Warning: The dot-dot notation (`..density..`) was deprecated in ggplot2 3.4.0.
## ℹ Please use `after_stat(density)` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
for (i in 1:length(continuous_vars)) {
var_label <- names(continuous_vars)[i]
var_name <- continuous_vars[[i]]
stats_summary <- lol_data %>%
summarise(Média = mean(.data[[var_name]], na.rm = TRUE), Mediana = median(.data[[var_name]], na.rm = TRUE))
cat(paste0("##### ", var_label, "\n\n"))
print(datatable(t(stats_summary), options = list(dom = 't', ordering=F), colnames = c('Medida', 'Valor'), class = 'cell-border stripe compact') %>% formatRound(columns = 1, digits = 4))
cat("\n\n")
}
for (i in 1:length(continuous_vars)) {
var_label <- names(continuous_vars)[i]
var_name <- continuous_vars[[i]]
stats_summary <- lol_data %>%
summarise('Desvio Padrão' = sd(.data[[var_name]], na.rm = TRUE), 'Variância' = var(.data[[var_name]], na.rm = TRUE))
cat(paste0("##### ", var_label, "\n\n"))
print(datatable(t(stats_summary), options = list(dom = 't', ordering=F), colnames = c('Medida', 'Valor'), class = 'cell-border stripe compact') %>% formatRound(columns = 1, digits = 4))
cat("\n\n")
}
for (i in 1:length(continuous_vars)) {
var_label <- names(continuous_vars)[i]
var_name <- continuous_vars[[i]]
var_data <- lol_data %>% select(all_of(var_name)) %>% filter(!is.na(.))
stats_summary <- var_data %>%
summarise('1º Quartil (Q1)' = quantile(.data[[var_name]], 0.25, na.rm = TRUE), '3º Quartil (Q3)' = quantile(.data[[var_name]], 0.75, na.rm = TRUE), 'Intervalo Interquartil (IQR)' = IQR(.data[[var_name]], na.rm = TRUE))
p_box <- ggplot(var_data, aes(x = "", y = .data[[var_name]])) +
geom_boxplot(fill = "#a9cce3", outlier.color = "red", outlier.shape = 18, outlier.size = 3) +
labs(title = paste("Box-plot de", var_label), subtitle = "Visualização de quartis e outliers", y = var_label, x = "")
cat(paste0("##### ", var_label, "\n\n"))
print(datatable(t(stats_summary), options = list(dom = 't', ordering=F), colnames = c('Medida', 'Valor'), class = 'cell-border stripe compact') %>% formatRound(columns = 1, digits = 4))
cat("\n\n")
print(p_box)
cat("\n\n")
}