Is there a way to include a panel for unused levels of a factor used in faceting?
The reason I want to do this is because I'm arranging several separate plots in rows showing different measures, with each row having the same number of facet_grid
panels in columns. Each plot should line up by column.
But when the data for one of the rows is missing data for a particular facet level, the number of panels will be different and the columns do not line up. For example, notice the last row is missing the "Mathematics II" panel:
Example plot http://dl.dropbox.com/u/14792859/ggplot2%20facet%20levels.png
The only work-around I can think of is to include a dummy data-point for any missing facet levels, but I would love to hear that there is an easier/cleaner way.
factor(df$subject, levels=union(levels(df$subject, other.df$subject)))
. - Daniel Dickison