library(readxl)
## Warning: package 'readxl' was built under R version 4.2.1
library(flextable)
## Warning: package 'flextable' was built under R version 4.2.1
library(dplyr)
## Warning: package 'dplyr' was built under R version 4.2.1
##
## 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
load("C:/Users/17325701756/Desktop/Base_de_dados-master/df_pokemon.RData")
pokémon = df
View(pokémon)
tabela = table(pokémon$attack,pokémon$type_1)
barplot(tabela)
pokémon %>% select(attack,type_1) %>%
group_by(type_1) %>%
summarise(média=mean(attack),
mediana=median(attack),
desvio_padrão=sd(attack)) %>%
flextable() %>% theme_tron()
type_1 | média | mediana | desvio_padrão |
bug | 65.22222 | 63.0 | 30.74161 |
dark | 86.25000 | 86.5 | 24.33657 |
dragon | 102.62500 | 97.5 | 29.64253 |
electric | 67.77778 | 61.5 | 25.15223 |
fairy | 61.52941 | 52.0 | 29.75130 |
fighting | 94.72000 | 100.0 | 27.66394 |
fire | 81.60870 | 82.5 | 25.29776 |
flying | 71.66667 | 70.0 | 42.52450 |
ghost | 66.65217 | 65.0 | 25.28674 |
grass | 70.90909 | 68.0 | 24.07790 |
ground | 91.30000 | 83.5 | 28.62498 |
ice | 70.69565 | 65.0 | 25.93600 |
normal | 71.73118 | 70.0 | 29.30096 |
poison | 74.67857 | 74.0 | 19.63001 |
psychic | 60.21739 | 52.5 | 30.76933 |
rock | 88.17500 | 86.5 | 32.57566 |
steel | 83.54545 | 82.5 | 24.60687 |
water | 71.04762 | 70.0 | 25.03013 |
boxplot(pokémon$attack ~ pokémon$type_1,
col=c("blue","aliceblue","gold3", "brown", "green","cyan", "aquamarine","brown3","purple","aquamarine3","darkgreen","azure","coral4","black","darkorchid1","azure4","coral","bisque","bisque1"),
main="Gráfico 1 - boxplot do ataque por tipo")