Q:

arranging columns and sub-columns in ggplot2 using facet_wrap?

I would like to know how can I group plots like the following ggplot (edited in paint): Plot
It looks like facet_wrap() and facet_grid() functions cannot be used to arrange the columns and sub-columns. 
Is there any R package that I can use?
Thanks

A:

You can multiply the factors used for columns and subcolumns.
library(ggplot2)

ggplot(mtcars, aes(disp, mpg)) + 
  geom_point() + 
  facet_wrap(~ cyl * gear, labeller = label_both)

The labeller label_both here also is useful as it adds the variable name before the value in the facet header.

