I originally was thinking of calling this post “Going back to the Base,” since I’m moving out of the tidyverse and into the world of matrices, but there’s really nothing basic about this. Yes - if we want to be super effective against Normal and Electric types, we need Fighting and Ground types respectively. Summarize(nb_super_effective = sum(ifelse(outcome = 2, 1, 0))) %>%įighting and Ground are both super effective against 5 different types, while Normal isn’t super effective against any.Īre there any types where only one Attacking type is super-effective? tidied_comparison %>% What types are super effective against the most other types? tidied_comparison %>% 5 if not very effective, and 0 if no effect. Here, outcome is 2 if it’s super effective (what we’re interested in), 1 if normal. We now have a dataset of 324 rows, with each Attacking-Defending combination and what the outcome is. : As Jim Hester kindly pointed out, read_csv() will work if I use it on the raw link, generated by clicking the “Raw” button.
On Github, I clicked to edit the file, copied everything in it, and then used tribble_paste(), which output my clipboard into the code that would create a tibble I called type_comparisons. Using read_csv() on the url didn’t work, and rather than try to debug it, I decided to “cheat”" and use the magic package datapasta package. I found a csv of the Pokémon type chart on GitHub. Along the way, we’ll do a quick exploratory analysis, learn about combinatorials, and leave the tidyverse to use matrices and some base functions. So I decided to use my R skills to answer this question (many thanks to my brother David Robinson for his guidance at various points). I knew there was a chart out there that matches up every attacking type against every defending and tells you whether they’re super effective, normal, not very effective, or doesn’t have any effect. This leads to the question - what are the combinations of 6 types that make you super effective against the most types of Pokémon? 1 It turns out this is a question a lot of people have asked. If you can set your team up so that you’re always optimally matched, you’re going to have a much easier time.īut there are 18 types and you only get 6 Pokémon on your team. For example, fire moves are super effective against grass Pokémon, which means they do double the damage they normally would. In battles, type match-ups are very important, as some types of moves are “super effective” against other types.
In the classic Pokémon games, you have a team of 6 Pokémon that you use to battle against other trainers. I recently started playing Pokémon again - “Pokémon Let’s Go Eevee” on the Nintendo Switch to be specific.