load("C:/Users/julia/Downloads/Base_de_dados-master/Base_de_dados-master/df_pokemon.RData")
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)
head(df)
## # A tibble: 6 x 22
## id pokemon species_id height weight base_experience type_1 type_2 attack
## <dbl> <chr> <int> <int> <int> <int> <chr> <chr> <int>
## 1 1 bulbasaur 1 7 69 64 grass poison 49
## 2 2 ivysaur 2 10 130 142 grass poison 62
## 3 3 venusaur 3 20 1000 236 grass poison 82
## 4 4 charmander 4 6 85 62 fire <NA> 52
## 5 5 charmeleon 5 11 190 142 fire <NA> 64
## 6 6 charizard 6 17 905 240 fire flying 84
## # ... with 13 more variables: defense <int>, hp <int>, special_attack <int>,
## # special_defense <int>, speed <int>, color_1 <chr>, color_2 <chr>,
## # color_f <chr>, egg_group_1 <chr>, egg_group_2 <chr>, url_image <chr>,
## # x <dbl>, y <dbl>
ft <- df %>% select(type_1, attack) %>% group_by(type_1) %>% summarise(Média_att=mean(attack),
Desvio_att=sd(attack),
Quantidade_Tipo_1=n()) %>%
data.frame() %>% flextable()
ft <- bg(ft, bg = "royalblue", part = "header")
ft <- bg(ft, bg = "blue", part = "body")
ft
type_1 | Média_att | Desvio_att | Quantidade_Tipo_1 |
bug | 65.22222 | 30.74161 | 63 |
dark | 86.25000 | 24.33657 | 28 |
dragon | 102.62500 | 29.64253 | 24 |
electric | 67.77778 | 25.15223 | 36 |
fairy | 61.52941 | 29.75130 | 17 |
fighting | 94.72000 | 27.66394 | 25 |
fire | 81.60870 | 25.29776 | 46 |
flying | 71.66667 | 42.52450 | 3 |
ghost | 66.65217 | 25.28674 | 23 |
grass | 70.90909 | 24.07790 | 66 |
ground | 91.30000 | 28.62498 | 30 |
ice | 70.69565 | 25.93600 | 23 |
normal | 71.73118 | 29.30096 | 93 |
poison | 74.67857 | 19.63001 | 28 |
psychic | 60.21739 | 30.76933 | 46 |
rock | 88.17500 | 32.57566 | 40 |
steel | 83.54545 | 24.60687 | 22 |
water | 71.04762 | 25.03013 | 105 |
boxplot(attack~type_1, data = df,
col=c("gold","violet","gray","purple","white","blue","red", "orange","red","blue", "red","yellow", "beige", "orange","orange","blue","red", "black"), main="Gráfico de ataque dos tipos de Pokemon",
xlab = "Tipos de Pokemon",
ylab = "Ataque" )
#DADOS POKEMON#
Para iniciar a atividade, foi feito o carregamento de dados. Feito isto, empreendi a relação das médias para finalizar e um bloxpot ao Pokemón e às suas defesas.
A respeito do cruzamento, leva-se em conta que os pokemon’s do tipo fairy e flighting apresentam menores oscilações de desvio.
Somado a isso, nota-se que steel e rock revelam a média de defesa maior.