title: Sort columns of a data frame by a vector of column names
body: <p>I have a data.frame that looks like this:
  <img src="https://i.stack.imgur.com/9AbPm.jpg" alt="enter image description here"></p>
  
  <p>which has 1000+ columns with similar names.</p>
  
  <p>And I have a vector of those column names that looks like this:
  <img src="https://i.stack.imgur.com/H83J6.jpg" alt="enter image description here"></p>
  
  <p>The vector is sorted by the cluster_id (which goes up to 11).</p>
  
  <p>I want to sort the columns in the data frame such that the columns are in the order of the names in the vector.</p>
  
  <p>A simple example of what I want is that:</p>
  
  <p><strong>Data:</strong></p>
  
  <pre><code> A    B    C
   1    2    3
   4    5    6
  </code></pre>
  
  <p><strong>Vector:</strong>
  c("B","C","A")</p>
  
  <p><strong>Sorted:</strong></p>
  
  <pre><code> B    C    A
   2    3    1
   5    6    4
  </code></pre>
  
  <p>Is there a fast way to do this?</p>