DATAFRAME
load("~/Base_de_dados-master/df_pokemon.RData")
BASES
library(readxl)
## Warning: package 'readxl' was built under R version 4.2.2
library(flextable)
## Warning: package 'flextable' was built under R version 4.2.2
library(dplyr)
## Warning: package 'dplyr' was built under R version 4.2.2
##
## 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
RESUMO
df %>%
select(speed,type_1)%>%
group_by(type_1) %>%
summarise(Velocidade.Média=mean(speed),
mediana=median(speed),
Desvio.Padrão=sd(speed),
Velocidade.Mínima=min(speed),
Velocidade.Máxima=max(speed)) %>%
flextable() %>% theme_vader()
type_1 | Velocidade.Média | mediana | Desvio.Padrão | Velocidade.Mínima | Velocidade.Máxima |
bug | 60.06349 | 57.0 | 32.23396 | 5 | 160 |
dark | 75.39286 | 70.0 | 25.05156 | 35 | 125 |
dragon | 76.66667 | 80.0 | 22.41053 | 40 | 110 |
electric | 83.52778 | 93.0 | 27.36367 | 35 | 140 |
fairy | 48.58824 | 45.0 | 23.30520 | 15 | 99 |
fighting | 62.88000 | 60.0 | 24.26815 | 25 | 118 |
fire | 74.47826 | 78.5 | 24.57798 | 20 | 126 |
flying | 96.33333 | 111.0 | 36.29509 | 55 | 123 |
ghost | 60.82609 | 56.0 | 27.54443 | 20 | 110 |
grass | 59.89394 | 56.5 | 25.81480 | 10 | 120 |
ground | 62.13333 | 60.0 | 27.44868 | 10 | 120 |
ice | 61.86957 | 59.0 | 23.75118 | 25 | 110 |
normal | 69.65591 | 70.0 | 26.98731 | 5 | 125 |
poison | 63.57143 | 62.5 | 22.63139 | 25 | 130 |
psychic | 72.63043 | 71.0 | 32.56198 | 20 | 150 |
rock | 51.97500 | 50.0 | 25.71589 | 10 | 130 |
steel | 54.18182 | 50.0 | 25.47760 | 23 | 108 |
water | 65.00952 | 65.0 | 22.61147 | 15 | 122 |
GRÁFICO BLOXPOT
boxplot(df$speed ~df$type_1,
par(cex=0.5),
col=c("red","blue"),
main="Qual tipo Pokémon é mais rápido?",
ylab="Velocidade", xlab="Tipagem")
INTERPRETAÇÃO DAS TABELAS E GRÁFICO
Inicialmente para criar a tabela foram escolhidas as variáveis type_1 e speed para dar inicio a tabela por grupos com a velocidade média,mediana, desvio padrão, velocidade mínima e velocidade máxima dos tipos de pokémon.
Ao criar a tabela podemos perceber que na maioria dos dados analisados, os pokémons do tipo voador(flying) saem na frente em todos menos em sua velocidade máxima, onde os pokémons do tipo inseto(bug) estão a frente.
Ao analisar o gráfico de caixas não há muitos pokémons que estão fora da curva, apenas 1 do tipo inseto(bug), 1 do tipo poison(venenoso) e 1 do tipo pedra(rock).Enquanto o equilibrio das linhas dentro das caixas temos poucas estando em assimetria.