title: Re order based on their ranks in geom_bar (dodge)
body: <p>This is my data: </p>
  
  <pre><code>Guild           Treatment   value
  Ins                Low      59.1
  InsAerGleEdge      Low      19.7
  InsAerOpen         Low      6.7
  InsAerGleEdgeClut  Low      4.4
  Frug               Low      3.7
  InsAerGleClut      Low      3.5
  InsAerEdge         Low      2.3
  InsGleClut         Low      0.6
  InsAerOpen        Medium    40.1
  Frug              Medium    24.3
  Ins               Medium    24.3
  InsAerGleEdge     Medium    5.3
  InsAerEdge        Medium    2.6
  InsAerGleEdgeClut Medium    2.6
  InsGleClut        Medium    0.7
  InsAerGleClut     Medium    0
  Frug               High     27.8
  InsAerEdge         High     18.6
  InsAerGleClut      High     16.7
  InsAerGleEdge      High     15.5
  Ins                High     11.7
  InsAerOpen         High     5.8
  InsAerGleEdgeClut  High     3.7
  InsGleClut         High     0.3
  </code></pre>
  
  <p>I would like to have a barplot using ggplot keeping the sequence of the guilds for each treatment. For example in:</p>
  
  <ol>
  <li>Treatment <code>Low</code> the sequence of guilds is <code>Ins, InsAerGleEdge, InsAerOpen</code> etc..based on the highest value. </li>
  <li>Treatment "Medium" is <code>InsAerOpen, Frug, Ins</code> etc. </li>
  </ol>
  
  <p>My problem is when I plot it in all the treatments it starts with the same guild. </p>
  
  <p>I have tried "reorder", "factor" but it doesn't change for each treatment individually. </p>
  
  <pre><code>Treatment&lt;-as.character(df$Treatment)
  df$Treatment&lt;-factor(df$Treatment, levels = c("Low", "Medium","High"))
  
  m&lt;-ggplot(df, aes(fill=Guild, y=value, x=Treatment)) + 
    geom_bar(position=position_dodge(), stat="identity",color="grey60")+
    scale_fill_manual(values=c("grey80", "grey30","grey60","grey40","grey50","grey70","grey90","grey20"))
  </code></pre>