library(tidyverse)
library(highcharter)
library(ggthemes)
library(ggdark)
library(ggimage)
library(patchwork)
highcharter::pokemon
## # A tibble: 718 x 20
## id pokemon species_id height weight base_experience type_1 type_2 attack
## <dbl> <chr> <int> <int> <int> <int> <chr> <chr> <int>
## 1 1 bulbas~ 1 7 69 64 grass poison 49
## 2 2 ivysaur 2 10 130 142 grass poison 62
## 3 3 venusa~ 3 20 1000 236 grass poison 82
## 4 4 charma~ 4 6 85 62 fire <NA> 52
## 5 5 charme~ 5 11 190 142 fire <NA> 64
## 6 6 chariz~ 6 17 905 240 fire flying 84
## 7 7 squirt~ 7 5 90 63 water <NA> 48
## 8 8 wartor~ 8 10 225 142 water <NA> 63
## 9 9 blasto~ 9 16 855 239 water <NA> 83
## 10 10 caterp~ 10 3 29 39 bug <NA> 30
## # ... with 708 more rows, and 11 more variables: defense <int>, hp <int>,
## # special_attack <int>, special_defense <int>, speed <int>, color_1 <chr>,
## # color_2 <chr>, color_f <chr>, egg_group_1 <chr>, egg_group_2 <chr>,
## # url_image <chr>
poke<- highcharter::pokemon
View(poke)
ggimage::geom_pokemon()
## geom_image: na.rm = FALSE, by = width, nudge_x = 0, .fun = function (id)
## {
## url <- paste0("https://raw.githubusercontent.com/Templarian/slack-emoji-pokemon/master/emojis/", id, ".png")
## check_url(url)
## }
## stat_identity: na.rm = FALSE
## position_identity
#psychic stats----
plot1 <-
filter(poke, type_1 == "psychic"| type_2 =="psychic") %>%
filter(species_id < 252) %>%
select(pokemon, speed) %>%
arrange(-speed) %>%
mutate(pokemon=fct_reorder(pokemon,speed)) %>%
mutate(pokemon_fix = recode(pokemon,"mr-mime"="mrmime")) %>%
ggplot(aes(x=speed, y=pokemon, image=pokemon_fix))+
geom_col(colour="black",fill="royalblue3",width=0.7)+
geom_pokemon()+
dark_theme_grey()+
labs(y="Psychic Type Pokemon",x="Speed",
title= "Speed of Psychic Type Pokemon",
subtitle="Gen I and II")
plot2<- filter(poke, type_1 == "psychic"| type_2 =="psychic") %>%
filter(species_id < 252) %>%
select(pokemon, attack) %>%
arrange(-attack) %>%
mutate(pokemon=fct_reorder(pokemon,attack)) %>%
mutate(pokemon_fix = recode(pokemon,"mr-mime"="mrmime")) %>%
ggplot(aes(x=attack, y=pokemon, image=pokemon_fix))+
geom_col(colour="black",fill="sienna1",width=0.7)+
geom_pokemon()+
dark_theme_grey()+
labs(y="Psychic Type Pokemon",x="Attack",
title= "Attack of Psychic Type Pokemon",
subtitle="Gen I and II")
plot1+plot2
