load("C:/Users/Liana/Desktop/Base_de_dados-master/df_pokemon.RData")
summary(df)
## id pokemon species_id height
## Min. : 1.0 Length:718 Min. : 1.0 Min. : 1.00
## 1st Qu.:180.2 Class :character 1st Qu.:180.2 1st Qu.: 6.00
## Median :359.5 Mode :character Median :359.5 Median : 10.00
## Mean :359.5 Mean :359.5 Mean : 11.41
## 3rd Qu.:538.8 3rd Qu.:538.8 3rd Qu.: 14.00
## Max. :718.0 Max. :718.0 Max. :145.00
## weight base_experience type_1 type_2
## Min. : 1.0 Min. : 36.00 Length:718 Length:718
## 1st Qu.: 95.0 1st Qu.: 65.25 Class :character Class :character
## Median : 280.0 Median :147.00 Mode :character Mode :character
## Mean : 568.2 Mean :141.55
## 3rd Qu.: 609.5 3rd Qu.:177.00
## Max. :9500.0 Max. :608.00
## attack defense hp special_attack
## Min. : 5.00 Min. : 5.00 Min. : 1.00 Min. : 10.00
## 1st Qu.: 53.00 1st Qu.: 50.00 1st Qu.: 50.00 1st Qu.: 45.00
## Median : 73.00 Median : 65.00 Median : 65.00 Median : 65.00
## Mean : 74.85 Mean : 70.67 Mean : 68.37 Mean : 68.47
## 3rd Qu.: 95.00 3rd Qu.: 85.00 3rd Qu.: 80.00 3rd Qu.: 90.00
## Max. :165.00 Max. :230.00 Max. :255.00 Max. :154.00
## special_defense speed color_1 color_2
## Min. : 20.00 Min. : 5.00 Length:718 Length:718
## 1st Qu.: 50.00 1st Qu.: 45.00 Class :character Class :character
## Median : 65.00 Median : 65.00 Mode :character Mode :character
## Mean : 69.09 Mean : 65.72
## 3rd Qu.: 85.00 3rd Qu.: 85.00
## Max. :230.00 Max. :160.00
## color_f egg_group_1 egg_group_2 url_image
## Length:718 Length:718 Length:718 Length:718
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
## x y
## Min. :-49.152 Min. :-45.793
## 1st Qu.:-17.695 1st Qu.:-17.293
## Median : 0.705 Median : -0.628
## Mean : 0.000 Mean : 0.000
## 3rd Qu.: 15.905 3rd Qu.: 18.155
## Max. : 53.142 Max. : 46.593
var(df$height)
## [1] 106.501
sd(df$height)
## [1] 10.31993
library(flextable)
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(reactable)
df %>% select(height, type_1) %>%
group_by(type_1) %>%
summarise(minimo=min(height),
primeiro_quartil=quantile(height, probs=0.25),
mediana=median(height),
terceiro_quartil=quantile(height, probs=0.75),
maximo=max(height)) %>%
flextable() %>% theme_tron()
type_1 | minimo | primeiro_quartil | mediana | terceiro_quartil | maximo |
bug | 1 | 5.00 | 8.0 | 12.00 | 25 |
dark | 4 | 5.75 | 10.0 | 14.00 | 58 |
dragon | 3 | 10.75 | 17.0 | 23.75 | 70 |
electric | 2 | 4.00 | 8.0 | 12.50 | 21 |
fairy | 1 | 3.00 | 6.0 | 11.00 | 30 |
fighting | 5 | 8.00 | 12.0 | 14.00 | 23 |
fire | 4 | 7.00 | 10.0 | 15.75 | 38 |
flying | 5 | 10.00 | 15.0 | 15.00 | 15 |
ghost | 3 | 6.00 | 10.0 | 15.00 | 45 |
grass | 2 | 5.00 | 9.0 | 12.00 | 33 |
ground | 2 | 7.00 | 10.0 | 15.00 | 35 |
ice | 4 | 8.00 | 11.0 | 14.50 | 26 |
normal | 2 | 5.00 | 9.0 | 12.00 | 37 |
poison | 4 | 6.75 | 11.0 | 16.25 | 35 |
psychic | 2 | 4.25 | 7.5 | 13.00 | 52 |
rock | 3 | 6.75 | 12.0 | 15.00 | 88 |
steel | 2 | 6.00 | 8.5 | 17.00 | 92 |
water | 3 | 6.00 | 10.0 | 15.00 | 145 |
boxplot(height~type_1, data = df,
col=c("orange", "pink"),
horizontal = T,
main="Gráfico Boxplot da altura por tipo 1 de pokemon")
Primeiramente, foi preciso carregar a base de dados “df_pokemon”, em seguida os dados foram analisados para encontrar possíveis erros, contudo não foi necessário tranformá-los, visto que havia variáveis qualitativas e quantitativas na mesma base de dados. Logo, no passo três houve o carregamento das bibliotecas de dados. Já no passo quatro, o cruzei as variáveis “height” e “type_1”. Na tabela é possível verificar o mínimo, primeiro quartil, mediana, terceiro quartil e máximo. O quinto e último passo, é necessário para gerar uma visualização da tabela do passo anterior e também facilita a interpretação e conclusão dos dados. Assim, pode-se afirmar que os tipos de pokemom “flying” e “fighting” possuem os maiores mínimo e menores máximos. Já os tipos de pokemons “water” e “steel” possuem os maiores máximos e o mesmo número no primeiro quartil (número 6).