title: Rearrange data frame in R
body: <p>there is a target vector </p>
  
  <pre><code>f=c(3,2,1,4)
  </code></pre>
  
  <p>and a two columns data frame (df)</p>
  
  <pre><code>2 4
  1 2
  7 8
  9 10
  </code></pre>
  
  <p>I want to rearrange all rows in the order of the target f vector..</p>
  
  <pre><code>7 8
  1 2
  2 4
  9 10
  </code></pre>
  
  <p>is there an easy way?</p>