I\'ve been reading the ggplot2 documentation for both functions. I was wondering what were the differences and what would be right situation for using each func
facet_wrap(...) strings together ggplots in different frames (facets) based in a single variable. facet_grid(...) can take two variables:
p + facet_grid(cyl~class)
You can also use a third variable to group in each facet:
qplot(displ, hwy, data=mpg,color=factor(year)) + facet_grid(cyl~class)
shows the improvement (or lack thereof) in hwy mileage vs. displacement by #cylinders and class.