Skip to content

Instantly share code, notes, and snippets.

@yutannihilation
Created October 23, 2018 23:01
Show Gist options
  • Save yutannihilation/c8f8ed07ea45d6ebd278ff5e983d3b0c to your computer and use it in GitHub Desktop.
Save yutannihilation/c8f8ed07ea45d6ebd278ff5e983d3b0c to your computer and use it in GitHub Desktop.
library(tidyverse)
library(gghighlight)

mtcars %>%
  select(mpg,cyl,disp,hp,drat) %>%
  gather(variable, value, -disp, -hp, -drat, -cyl) %>%
  mutate(cyl = factor(cyl)) %>% 
  ggplot(aes(disp,value,color=factor(drat))) +
  facet_wrap( ~ cyl, labeller = label_both, drop = FALSE) +
  geom_point() +
  gghighlight(drat >= 4, use_group_by = FALSE) +
  theme_bw()

Created on 2018-10-24 by the reprex package (v0.2.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment