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 = "white", part = "body")
ft
boxplot(attack~type_1, data = df,
        col=c("red","pink","orange","black","white","purple","gray", "violet","gold","violet", "red","yellow", "beige", "orange","brown","green","pink", "white"), main="Gráfico de ataque dos tipos de Pokemon",
        xlab = "Tipos de Pokemon",
        ylab = "Ataque" )

##DADOS POKEMON##

  Para realizar o trabalho se fez necessário a importação dos dados fornecidos. 
  Após a importação foi feito o cruzamento das médias variáveis e para melhor vizuação foi feita a ferramenta gráfica do Bloxpot, relacionando as defesas do Pokemon.
  Analisando os dados fornecidos, nota-se que os que possuem menores desvios são fairy e figthing, já os que possuem maior média de defesa são do tipo steel e rock.