Learn R Programming

Rokemon (version 0.0.1)

theme_rocket: Theme Rocket

Description

ggplot theme of Team Rocket. Meowth that's right!

Usage

theme_rocket(...)

Arguments

...

additional parameters to ggplot2::theme()

Examples

Run this code
# 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")
# }

Run the code above in your browser using DataLab