Agenda


Libraries


library(ggplot2)

Facet - Intro


Generate subplots that each display one subset of the data using

  • facet_grid()
  • facet_wrap()

Columns


ggplot(mtcars, aes(disp, mpg)) + 
  geom_point() +
  facet_grid(. ~ cyl)

Rows


ggplot(mtcars, aes(disp, mpg)) + 
  geom_point() +
  facet_grid(cyl ~ .)