title: Need to properly reorder bars based on count after summarizing by more than one variable
body: <p>I know how to easily reorder my bars chart based on count.  For example:</p>
  
  <pre><code>library(magrittr)
  library(dplyr)
  library(ggplot2)
  
  #Convert columns of interest to factors
  mtcars$gear &lt;- as.factor(mtcars$gear)
  mtcars$cyl &lt;- as.factor(mtcars$cyl)
  summary_df1 &lt;- mtcars %&gt;% group_by(gear) %&gt;% summarize(num1 = n())
  ggplot(summary_df1, aes(x = reorder(gear, num1), y = num1)) + geom_bar(stat = "identity") + coord_flip()
  </code></pre>
  
  <p>Now I want to add an additional variable to fill the bars by, but I still want to reorder the bars based on the total count like I did previously.  However this is not working:</p>
  
  <pre><code>summary_df2 &lt;- mtcars %&gt;% group_by(gear, cyl) %&gt;% summarize(num2 = n())
  ggplot(summary_df2, aes(x = reorder(gear, num2), y = num2, fill = cyl)) + geom_bar(stat = "identity") + coord_flip()
  </code></pre>
  
  <p>Any help would be appreciated.
  Thanks.</p>