title: Sorting a data frame by one column by string and number in R
body: <p>I have a data frame which I want to sort. However, the column I want to sort by is a combination of a letter and a number. </p>
  
  <pre><code>df &lt;- data.frame(a = sample(paste0("C", 1:20)), b = sample(LETTERS[1:26],20))
  df[order(df$a),]
  </code></pre>
  
  <p>Ordering likes this gives me C1, C10, C11, ..., C19, C2, C20, ...</p>
  
  <p>What do I need to change in order to sort the column like this: C1, C2, C3, ...</p>
  
  <p>Thank you. :-)</p>