library(ggplot2)
Generate subplots that each display one subset of the data using
facet_grid()
facet_wrap()
ggplot(mtcars, aes(disp, mpg)) +
geom_point() +
facet_grid(. ~ cyl)
ggplot(mtcars, aes(disp, mpg)) +
geom_point() +
facet_grid(cyl ~ .)