Description Usage Arguments Examples
View source: R/theme_gameboy.R
ggplot theme of Team Rocket. Meowth that's right!
1 |
... |
additional parameters to ggplot2::theme() |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Not run:
#create a Pokemon type effectiveness chart
library(tidyverse)
pokemon %>%
distinct(type1,.keep_all=TRUE) %>%
select(defender = type1,against_bug:against_water) %>%
gather(attacker,effect,against_bug:against_water) %>%
mutate(attacker = str_replace_all(attacker,"against_","")) %>%
ggplot(aes(y=attacker,x=defender,fill=factor(effect)))+
geom_tile()+
geom_text(aes(label=ifelse(effect!=1,effect,"")))+
scale_fill_manual(values=c("#8B1A1A", "#CD2626", "#EE2C2C", "#FFFFFF", "#00CD00", "#008B00"))+
theme_rocket(legend.position="none")+
labs(title="Effectiveness Table")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.