Introduction


In the world of Pokémon there are 18 types that are properties of the Pokémon and their moves. A Pokémon may have one or two types (dual type), meaning that there are 324 posible combinations, 18 single type Pokémon and 306 dual types Pokémon. However in the games, there are no differences between the order of the types in a dual type Pokémon, in other words, a Flying/Dragon Pokémon is treated in the same way a Dragon/Flying Pokémon is treated.

In this work we will take a look at dual type Pokémon. The analysis is mostly an exploratory data analysis where we will study topics such as most frequent secondary type by primary type, the most common secondary types by region and in the last part, we will introduce a prediction model to see if there is any relation between dual types Pokémon and their region of origin.

Unlike the games, we will consider the order of the types of a dual type Pokémon using the way it is documented in the Pokedex. For example, we will treat a Flying/Dragon Pokémon such as Noivern and Dragon/Flying Pokémon like Altaria as having two different types.

The Pokémon included in this study are the ones currently available in the National Pokedex, starting with Bulbasaur and ending with Zygarde; a total of 718 Pokémon. Also, Mega Pokémon and alternate forms of Pokémon like Rotom forms and the Therian forms are not included.

The dataset


Our original dataset consists of two columns called dataset.Type.1 and dataset.Type.2. The first column, dataset.Type.1 has the primary type of the Pokémon and the second one, dataset.Type.2, the secondary type. If the Pokémon does not have a secondary type, the corresponding entry in dataset.Type.2 is <NA> (not applicable). The dataset has a total of 718 observations (rows) because we are working with the National Pokedex and you may have noticed, the name of the Pokémon is not included, the reason behind this is that it is not really necessary since we are just interested in the types. Instead, we use the index or the number of the row. For example, row number 4 is a pure Fire type Pokémon (Charmander).

##   dataset.Type.1 dataset.Type.2
## 1          Grass         Poison
## 2          Grass         Poison
## 3          Grass         Poison
## 4           Fire           <NA>
## 5           Fire           <NA>
## 6           Fire         Flying

Overview of dual types

The following matrix shows the total of dual types Pokémon per each primary type. Each row represents a primary type and the columns the secondary type. For example, the matrix shows there are 2 Bug/Electric Pokémon, 1 Bug/Fighting, 2 Bug/Fire and so on. The -1 entries means that it does not apply, since for example a Bug/Bug Pokémon would be a pure Bug type, and pure types are out of the score of this analysis.

##               dataset.Type.2
## dataset.Type.1 Bug Dark Dragon Electric Fairy Fighting Fire Flying Ghost
##       Bug       -1    0      0        2     0        1    2     13     1
##       Dark       0   -1      3        0     0        2    2      5     1
##       Dragon     0    0     -1        1     0        0    1      4     0
##       Electric   0    0      0       -1     1        0    0      3     1
##       Fairy      0    0      0        0    -1        0    0      2     0
##       Fighting   0    1      0        0     0       -1    0      1     0
##       Fire       0    0      0        0     0        6   -1      5     0
##       Flying     0    0      2        0     0        0    0     -1     0
##       Ghost      0    1      1        0     0        0    3      2    -1
##       Grass      0    3      0        0     2        3    0      4     0
##       Ground     0    3      2        1     0        0    0      3     2
##       Ice        0    0      0        0     0        0    0      2     1
##       Normal     0    0      0        0     4        0    0     23     0
##       Poison     1    3      1        0     0        2    0      3     0
##       Psychic    0    0      0        0     5        1    1      6     0
##       Rock       2    1      2        0     1        1    0      3     0
##       Steel      0    0      1        0     2        1    0      1     3
##       Water      0    4      2        2     2        2    0      7     2
##               dataset.Type.2
## dataset.Type.1 Grass Ground Ice Normal Poison Psychic Rock Steel Water
##       Bug          6      1   0      0     11       0    3     5     1
##       Dark         0      0   2      0      0       2    0     2     0
##       Dragon       0      4   1      0      0       2    0     0     0
##       Electric     0      0   0      2      0       0    0     3     0
##       Fairy        0      0   0      0      0       0    0     0     0
##       Fighting     0      0   0      0      0       2    0     1     0
##       Fire         0      2   0      2      0       1    1     1     0
##       Flying       0      0   0      0      0       0    0     0     0
##       Ghost        4      0   0      0      3       0    0     0     0
##       Grass       -1      1   2      0     14       2    0     2     0
##       Ground       0     -1   0      0      0       2    3     1     0
##       Ice          0      3  -1      0      0       2    0     0     3
##       Normal       2      1   0     -1      0       2    0     0     1
##       Poison       0      2   0      0     -1       0    0     0     1
##       Psychic      1      0   0      0      0      -1    0     0     0
##       Rock         2      6   2      0      0       2   -1     3     6
##       Steel        0      1   0      0      0       6    3    -1     0
##       Water        3      9   3      0      3       4    4     1    -1

The next figure, a heat map, shows the same information from the previous table in another way. The Y axis is the primary type and the X axis the secondary one. Regardings the colors, the darker they are, the smaller the frequency is and the lighest the color is, higher the frequency is.

Frequent secondary type by primary type

The figures in the section shows the quantity of secondary types by primary type. For example the first plot can be interpreted as this, “there are 13 Bug/Flying Pokémon, 11 Bug/Poison and so on.”

Bug dual types

##  dataset.Type.1 dataset.Type.2 Freq
##             Bug         Flying   13
##             Bug         Poison   11
##             Bug          Grass    6
##             Bug          Steel    5
##             Bug           Rock    3
##             Bug       Electric    2
##             Bug           Fire    2
##             Bug       Fighting    1
##             Bug          Ghost    1
##             Bug         Ground    1
##             Bug          Water    1
##             Bug           Dark    0
##             Bug         Dragon    0
##             Bug          Fairy    0
##             Bug            Ice    0
##             Bug         Normal    0
##             Bug        Psychic    0

Dark dual types

##  dataset.Type.1 dataset.Type.2 Freq
##            Dark         Flying    5
##            Dark         Dragon    3
##            Dark       Fighting    2
##            Dark           Fire    2
##            Dark            Ice    2
##            Dark        Psychic    2
##            Dark          Steel    2
##            Dark          Ghost    1
##            Dark            Bug    0
##            Dark       Electric    0
##            Dark          Fairy    0
##            Dark          Grass    0
##            Dark         Ground    0
##            Dark         Normal    0
##            Dark         Poison    0
##            Dark           Rock    0
##            Dark          Water    0