load("C:/Users/Dell/Desktop/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)
df %>% select(height,type_1) %>%
group_by(type_1) %>%
summarise(Média=round(mean(height),2),
Desvio_Padrão=round(sd(height),2),
Mediana=median(height)) %>% flextable() %>% theme_box()type_1 | Média | Desvio_Padrão | Mediana |
bug | 8.60 | 4.93 | 8.0 |
dark | 11.46 | 10.03 | 10.0 |
dragon | 20.38 | 15.47 | 17.0 |
electric | 8.94 | 5.31 | 8.0 |
fairy | 8.35 | 7.09 | 6.0 |
fighting | 11.68 | 4.62 | 12.0 |
fire | 11.50 | 6.34 | 10.0 |
flying | 11.67 | 5.77 | 15.0 |
ghost | 11.61 | 8.85 | 10.0 |
grass | 9.83 | 6.20 | 9.0 |
ground | 12.07 | 7.75 | 10.0 |
ice | 12.09 | 6.12 | 11.0 |
normal | 9.80 | 6.17 | 9.0 |
poison | 12.14 | 7.31 | 11.0 |
psychic | 9.57 | 8.02 | 7.5 |
rock | 13.40 | 13.37 | 12.0 |
steel | 15.82 | 20.33 | 8.5 |
water | 13.21 | 16.36 | 10.0 |
library(RColorBrewer)
COR <- brewer.pal(12,"Set3")
par(cex=0.5)
boxplot(height~type_1, data = df, col= c(COR,"#F5A9F2","#B45F04","#BCA9F5","#F3E2A9","#CEF6CE","#F7FE2E"),
main="Boxplot da altura por tipo de pokemon", horizontal=F,
ylim=c(0,145), ylab = "Altura", xlab = "Tipo 1")par(cex=1)
boxplot(height~type_1, data = df, col= c(COR,"#F5A9F2","#B45F04","#BCA9F5","#F3E2A9","#CEF6CE","#F7FE2E"),
main="Boxplot da altura por tipo de pokemon:
fonte maior para melhor visualização", horizontal=F,
ylim=c(1,145), ylab = "Altura", xlab = "Tipo 1")