title: Reorder bars in geom_bar ggplot2 by value
body: <p>I am trying to make a bar-plot where the plot is ordered from the <code>miRNA</code> with the highest <code>value</code> to the <code>miRNA</code> with the lowest. Why does my code not work?</p>
  
  <pre><code>&gt; head(corr.m)
  
          miRNA         variable value
  1    mmu-miR-532-3p      pos     7
  2    mmu-miR-1983        pos    75
  3    mmu-miR-301a-3p     pos    70
  4    mmu-miR-96-5p       pos     5
  5    mmu-miR-139-5p      pos    10
  6    mmu-miR-5097        pos    47
  
  ggplot(corr.m, aes(x=reorder(miRNA, value), y=value, fill=variable)) + 
    geom_bar(stat="identity")
  </code></pre>