load("E:/estatistica/aula estatistica/Base_de_dados-master/df_pokemon.RData")
View(df)
df$type_1 <- as.factor (df$type_1)
df$type_2 <- as.factor (df$type_2)
library(knitr)
## Warning: package 'knitr' was built under R version 3.5.3
tipo1 <- summary(df$type_1)
tipo2 <- summary(df$type_2)
kable(tipo1)
| x | |
|---|---|
| bug | 63 |
| dark | 28 |
| dragon | 24 |
| electric | 36 |
| fairy | 17 |
| fighting | 25 |
| fire | 46 |
| flying | 3 |
| ghost | 23 |
| grass | 66 |
| ground | 30 |
| ice | 23 |
| normal | 93 |
| poison | 28 |
| psychic | 46 |
| rock | 40 |
| steel | 22 |
| water | 105 |
kable(tipo2)
| x | |
|---|---|
| bug | 3 |
| dark | 16 |
| dragon | 14 |
| electric | 6 |
| fairy | 17 |
| fighting | 19 |
| fire | 9 |
| flying | 87 |
| ghost | 11 |
| grass | 18 |
| ground | 30 |
| ice | 10 |
| normal | 4 |
| poison | 31 |
| psychic | 27 |
| rock | 14 |
| steel | 19 |
| water | 12 |
| NA’s | 371 |
library(knitr)
tab_tipos <- table(df$type_1,df$type_2)
kable(tab_tipos, caption = "Combina攼㸷昼㸵es possiveis de tipos de pokemon em quantidade")
| bug | dark | dragon | electric | fairy | fighting | fire | flying | ghost | grass | ground | ice | normal | poison | psychic | rock | steel | water | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| bug | 0 | 0 | 0 | 2 | 0 | 1 | 2 | 13 | 1 | 6 | 1 | 0 | 0 | 11 | 0 | 3 | 5 | 1 |
| dark | 0 | 0 | 3 | 0 | 0 | 2 | 2 | 5 | 1 | 0 | 0 | 2 | 0 | 0 | 2 | 0 | 2 | 0 |
| dragon | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 4 | 0 | 0 | 4 | 1 | 0 | 0 | 2 | 0 | 0 | 0 |
| electric | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 | 1 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 3 | 0 |
| fairy |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2 | 0 | 7 | 2 | 3 | 9 | 3 | 0 | 3 | 4 | 4 | 1 | 0 |
Baseando se na Tabela acima podemos observar que a combinação de tipos que se apresenta como sendo a mais comum é a normal/voador com 23. O principal motivo disso se deve ao fato de em cada nova versão um novo pokemon apresenta essa combinação representando o pokemon mais commun da região e que em geral possui 2 evoluções representando um aumento de trêz a tabela. Um exemplo disso é o Pidgey da primeira geração
seguido por grama/veneno com 14,
depois pela combinação inseto/voador com 13
e em quarto lugar inseto/veneno com 11.
É importante observar que os numeros de combinações nao são tao grandes apesar do incrivel numero de pokemons a razão disso é porque quase metade deles não possuem um segundo tipo e portanto são excluidos do calculo. Outra observação importante é que o tipo voador é o tipo mais comum como tipo secundario