title: how to sort data frame by column names in R?
body: <p>How can I sort the below data frame <code>df</code> to <code>df1</code>?</p>
  
  <pre><code>df
  a1 a4 a3 a5 a2
  </code></pre>
  
  <p>sorted data frame</p>
  
  <pre><code>df1
  a1 a2 a3 a4 a5
  </code></pre>