At the moment you cannot pass expressions to facet_wrap
, so one approach to create a factor column with the levels in the order you wish. The idiomatic R
approach is to use reorder
# create factor
dataset$State_lab <- with(dataset, reorder(x=State,X=mean))
# your plot
qplot(Date,Count,data=dataset) + facet_wrap(~State_lab)