title: How to sort frequencies in CreateTableOne
body: <p>Here is a representation of my dataset</p>
  <pre><code>mydata&lt;-data.frame(ID=1:37,var=c(rep(&quot;A&quot;,12),rep(&quot;B&quot;,8),rep(&quot;C&quot;,17)))
  </code></pre>
  <p>I calculated the frequency of each modality of the variable <code>var</code></p>
  <pre><code>library(tableone)
  
  CreateTableOne(data = mydata[&quot;var&quot;])
  </code></pre>
  <p>What I want is to sort the frequencies in decreasing way, like below:</p>
  <pre><code>          Overall   
    n       37        
    var (%)        
       C    17 (45.9)    
       A    12 (32.4) 
       B     8 (21.6) 
  </code></pre>