title: Maintaining order in subseting dataframe in R
body: <p>I have a dataframe <code>df</code> : </p>
  
  <pre><code>V1  V2  V3
  1   227 Day1
  2   288 Day2
  3   243 Day3
  4   258 Day4
  5   274 Day5
  6   245 Day6
  7   254 Day7
  8   249 Day8
  9   230 Day9
  10  244 Day10
  </code></pre>
  
  <p>I want to subset <code>df</code> where <code>V1</code> contains <code>5,1,7,3</code> in order. I used <code>subset(df,V1 %in% c(5,1,7,3))</code> but what I am getting is:  </p>
  
  <pre><code>V1  V2  V3
  1   227 Day1
  3   243 Day3
  5   274 Day5
  7   254 Day7
  </code></pre>
  
  <p>I want to maintain the order of rows in <code>V1</code> to be <code>5,1,7,3</code> and not <code>1,3,5,7</code>. How can I have the output to be: </p>
  
  <pre><code>V1  V2  V3
  5   274 Day5
  1   227 Day1
  7   254 Day7
  3   243 Day3
  </code></pre>