title: Reorder factors by increasing frequency
body: <p>How do I reorder factor-valued columns by frequency - in increasing order?</p>
  
  <p>While the forcats package provides an explicit way to reorder a factor based on its frequency (<a href="https://www.rdocumentation.org/packages/forcats/versions/0.2.0/topics/fct_inorder" rel="nofollow noreferrer">fct_infreq()</a>), it does so in decreasing frequency order. I need the reverse order of the factor frequency/counts.</p>
  
  <p>E.g.</p>
  
  <pre><code>library(forcats)
  set.seed(555)
  df &lt;- data.frame(x=factor(sample(as.character(1:10), 100, replace=TRUE)))
  table(df$x)
  
  1 10   2  3  4  5  6  7  8  9 
  9 10  12 14 10 10  5 12  8 10 
  
  levels(fct_infreq(df$x))
  
  [1] "3"  "2"  "7"  "10" "4"  "5"  "9"  "1"  "8"  "6" 
  </code></pre>
  
  <p>Is there a simple way to flip the ordering so that the least frequent factor ("6") is first and the most frequent ("3") last?</p>