# A standard plot
p <- ggplot(mpg, aes(displ, hwy)) +
geom_point()
# Combine the strips
p + facet_wrap2(vars(cyl, drv), strip = strip_nested())
# The facet_nested and facet_nested_wrap functions have nested strips
# automatically
p + facet_nested_wrap(vars(cyl, drv))
# Changing the bleed argument merges the "f" labels in the top-right
p + facet_wrap2(vars(cyl, drv), strip = strip_nested(bleed = TRUE))
Run the code above in your browser using DataLab