title: Forest plot (ggplot2) and order of variables
body: <p>I have a data.frame (d) that looks like this: </p>
  
  <blockquote>
  <pre><code>x     y     ylo    yhi 
  A   0.21    0.01   0.41
  D   0.11   -0.09   0.31  
  M   0.13   -0.07   0.33 
  N   0.14   -0.06   0.34
  F   0.17   -0.03   0.37
  </code></pre>
  </blockquote>
  
  <p>I plotted a forest plot using the following code I found on the web: </p>
  
  <blockquote>
  <pre><code>credplot.gg &lt;- function(d){
  require(ggplot2)
  p &lt;- ggplot(d, aes(x=x, y=y, ymin=ylo, ymax=yhi))+geom_pointrange()+
         coord_flip() + geom_hline(aes(x=0), lty=2)+ xlab('Variable')
  return(p)
  </code></pre>
    
    <p>}</p>
    
    <p>credplot.gg(d)</p>
  </blockquote>
  
  <p>It returns to me the forest plot I need except the fact that the order of my d$x column is changed. Is it possible to plot the forest plot maintaining the order of the elements in the column d$x?</p>