[R] ggplot2: removing empty factor levels in facet_grid

2014-02-03 Thread Anna Zakrisson Braeunlich
Hi, I would like to thank you for a great package and for all help I have recieved in the past. To my question: I have a plot where I have used facet_grid. I have factor: station (B1, BY31, H2) and factor: year (2007, 2008). The plot has two plot panels empty as there are no combinations

Re: [R] ggplot2: removing empty factor levels in facet_grid

2014-02-03 Thread Ista Zahn
Hi Anna, It's unclear what you want here, as it doesn't make sense in this example to remove the empty panels. Doing so will mess up the alignment of the remaining panels. Perhaps you want ggplot(mydata,aes(week,values))+ facet_wrap(~year+station, scales = fixed, drop=TRUE)+