load("C:/Users/digos/Downloads/Base_de_dados-master/df_pokemon.RData")
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"
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)
df %>% select(attack,type_1) %>%
group_by("Tipo 1" = type_1) %>%
summarise(Média=round(mean(attack),2),
"Desvio Padrão"=round(sd(attack),2)) %>%
flextable() %>% theme_vader()
Tipo 1 | Média | Desvio Padrão |
|---|---|---|
bug | 65.22 | 30.74 |
dark | 86.25 | 24.34 |
dragon | 102.62 | 29.64 |
electric | 67.78 | 25.15 |
fairy | 61.53 | 29.75 |
fighting | 94.72 | 27.66 |
fire | 81.61 | 25.30 |
flying | 71.67 | 42.52 |
ghost | 66.65 | 25.29 |
grass | 70.91 | 24.08 |
ground | 91.30 | 28.62 |
ice | 70.70 | 25.94 |
normal | 71.73 | 29.30 |
poison | 74.68 | 19.63 |
psychic | 60.22 | 30.77 |
rock | 88.17 | 32.58 |
steel | 83.55 | 24.61 |
water | 71.05 | 25.03 |
df %>% select(attack,type_1) %>%
group_by("Tipo 1" = type_1) %>%
summarise(Mínimo=min(attack),
"Primeiro Quartil"=quantile(attack,probs=0.25),
Mediana=round(median(attack),2),
"Terceiro Quartil"=quantile(attack,probs=0.75),
Máximo=max(attack)) %>%
flextable() %>% theme_tron()
Tipo 1 | Mínimo | Primeiro Quartil | Mediana | Terceiro Quartil | Máximo |
|---|---|---|---|---|---|
bug | 10 | 42.50 | 63.0 | 90.00 | 135 |
dark | 50 | 65.00 | 86.5 | 97.50 | 131 |
dragon | 50 | 78.75 | 97.5 | 130.00 | 150 |
electric | 30 | 50.00 | 61.5 | 85.00 | 123 |
fairy | 20 | 45.00 | 52.0 | 72.00 | 131 |
fighting | 35 | 80.00 | 100.0 | 120.00 | 140 |
fire | 40 | 60.75 | 82.5 | 97.75 | 140 |
flying | 30 | 50.00 | 70.0 | 92.50 | 115 |
ghost | 30 | 50.00 | 65.0 | 85.00 | 115 |
grass | 27 | 53.50 | 68.0 | 89.75 | 130 |
ground | 40 | 72.00 | 83.5 | 115.75 | 150 |
ice | 30 | 50.00 | 65.0 | 82.50 | 130 |
normal | 5 | 55.00 | 70.0 | 85.00 | 160 |
poison | 43 | 60.00 | 74.0 | 90.50 | 106 |
psychic | 20 | 36.25 | 52.5 | 74.50 | 150 |
rock | 40 | 58.00 | 86.5 | 112.75 | 165 |
steel | 24 | 75.00 | 82.5 | 97.50 | 135 |
water | 10 | 52.00 | 70.0 | 90.00 | 130 |
par(cex=0.5)
boxplot(attack~type_1, data = df,
col=c("yellow","green"),
main= "Gráfico tipo de atques dos pokemons",
ylab = "Ataques",
xlab = "Pokemon")