title: How to make pretty ordered facet labels for numeric values?
body: <p>I often facet according to a numeric variable, but I want the facet label to be more explanatory than the simple number.  I usually create a new label variable that has the numeric value pasted to explanatory text.  However, when values have more than one place before the decimal, the first number is used for sorting the factor.  Any suggestions to avoid this?</p>
  
  <pre><code>iris[,1:4]&lt;-iris[,1:4]*10
  </code></pre>
  
  <p>This would work fine for iris, when it does not have more than one value before the decimal.</p>
  
  <pre><code>iris$Petal.Width.label&lt;-paste("Petal.Width=", iris$Petal.Width)
  
  
  
  iris$Petal.Width.label&lt;-paste("Petal.Width=", iris$Petal.Width)
  
  
  qplot(data=iris,
        x=Sepal.Length,
        y=Sepal.Width,
        colour=Species)+facet_wrap(~Petal.Width.label)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/oVyZJ.png" alt="Plot with miss ordered facets"></p>
  
  <p>Related to:<br>
  <a href="https://stackoverflow.com/questions/3472980/ggplot-how-to-change-facet-labels">ggplot: How to change facet labels?</a><br>
  <a href="https://stackoverflow.com/questions/5490638/how-to-change-the-order-of-facet-labels-in-ggplot-custom-facet-wrap-labels">How to change the order of facet labels in ggplot (custom facet wrap labels)</a>  </p>