load("C:/Users/barba/Desktop/Base_de_dados-master/df_pokemon.RData")
View(df)
names(df)
## [1] "id" "pokemon" "species_id" "height"
## [5] "weight" "base_experience" "type_1" "type_2"
## [9] "attack" "defense" "hp" "special_attack"
## [13] "special_defense" "speed" "color_1" "color_2"
## [17] "color_f" "egg_group_1" "egg_group_2" "url_image"
## [21] "x" "y"
var(df$attack)
## [1] 837.3524
sd(df$attack)
## [1] 28.93704
mean(df$attack)
## [1] 74.85376
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
library(flextable)
library(reactable)
df %>% select(attack,type_2) %>%
group_by(type_2) %>%
summarise(MEDIA=round(mean(attack),2),DESVIO_PADRAO=round(sd(attack),2)) %>%
flextable() %>% theme_tron_legacy()
type_2 | MEDIA | DESVIO_PADRAO |
bug | 90.00 | 37.75 |
dark | 98.56 | 21.18 |
dragon | 88.93 | 25.53 |
electric | 72.67 | 40.30 |
fairy | 46.88 | 21.20 |
fighting | 99.89 | 21.13 |
fire | 71.11 | 29.45 |
flying | 75.53 | 30.39 |
ghost | 75.73 | 25.68 |
grass | 72.83 | 22.89 |
ground | 83.37 | 24.66 |
ice | 88.50 | 23.26 |
normal | 52.75 | 12.42 |
poison | 63.97 | 21.27 |
psychic | 69.81 | 24.51 |
rock | 84.00 | 33.70 |
steel | 88.05 | 32.85 |
water | 67.25 | 26.30 |
72.90 | 28.87 |
df %>% select(attack,type_2) %>%
group_by(type_2) %>%
summarise(minimo=min(attack),
primeiro_quartil=quantile(attack,probs=0.25),
mediana=median(attack),
terceiro_quartil=quantile(attack,probs=0.75),
maximo=max(attack)) %>%
flextable() %>% theme_tron_legacy()
type_2 | minimo | primeiro_quartil | mediana | terceiro_quartil | maximo |
bug | 50 | 72.50 | 95.0 | 110.00 | 125 |
dark | 63 | 88.00 | 94.0 | 117.75 | 134 |
dragon | 30 | 71.25 | 92.0 | 103.75 | 121 |
electric | 38 | 49.75 | 62.0 | 74.25 | 150 |
fairy | 20 | 27.00 | 45.0 | 65.00 | 85 |
fighting | 61 | 87.50 | 95.0 | 121.50 | 130 |
fire | 30 | 55.00 | 60.0 | 90.00 | 120 |
flying | 20 | 51.00 | 75.0 | 90.00 | 150 |
ghost | 40 | 55.00 | 75.0 | 85.00 | 124 |
grass | 30 | 59.25 | 70.0 | 93.75 | 110 |
ground | 45 | 64.25 | 85.0 | 100.00 | 130 |
ice | 59 | 71.75 | 88.5 | 95.00 | 130 |
normal | 38 | 47.00 | 52.5 | 58.25 | 68 |
poison | 25 | 50.00 | 62.0 | 81.00 | 105 |
psychic | 24 | 54.50 | 75.0 | 84.50 | 135 |
rock | 10 | 66.25 | 87.5 | 104.75 | 140 |
steel | 35 | 57.50 | 90.0 | 115.00 | 135 |
water | 30 | 49.00 | 60.0 | 81.25 | 115 |
5 | 51.50 | 70.0 | 90.50 | 165 |
par(bg="#32a1d9")
boxplot(attack~type_2, data = df,
col=c("#250c57","#7447cc","#5c15e8","#b595f5","#200b4a"),
las = 2,
main= "Boxplot - Ataque por tipo 2 de pokémon")
Podemos analisar que o desvio-padrão de ataque por tipo 2 de Pokémons se mantem na faixa entre 20 a 30, salva as poucas exceções. Já em relação, a média de ataques já temos uma variação maior muito maior.
No box-plot, podemos ver a presença outliers, indicando que existem valores discrepantes (no caso, nos tipos voadores, elétricos e psiquicos).
Ainda no box-plot, podemos analisar que os valores dos atauqes são bastante assimétricos.