title: Reorder rows in data.table in a specific order
body: <p>I have a <code>data.table</code> <code>dumdt</code>:</p>
  
  <pre><code>set.seed(123)
  dumdt &lt;- data.table(v1=sample(1:10, 5), v2=1:5)
  </code></pre>
  
  <p>whose rows I'd like to reorder in this specific indices order (so first the third observation, then the fifth, then second, etc.): </p>
  
  <pre><code>to_ord &lt;- c(3, 5, 2, 1, 4)
  </code></pre>
  
  <p>So I'd like <code>dumdt</code> to be the result of <code>dumdt[to_ord]</code> but I also would like to do it by reference and avoid doing <code>dumdt &lt;- dumdt[to_ord]</code>.</p>
  
  <p>I know I can reorder rows by reference with <code>setorder</code> (or <code>setorderv</code>) but only according to one or several variables, in ascending or descending order, not in a customised order.<br>
  However, if I wanted to reorder the columns, not the rows, in a customised order, I could use <code>setcolorder</code>.</p>
  
  <p>So here comes my question : is there a function that would work like <code>setcolorder</code> but with the rows (or a way to use <code>setorder</code> to do the same) ?</p>
  
  <p>My desired output would be something like</p>
  
  <pre><code>setroworder(x=dumdt, neworder=to_ord)
  dumdt
     # v1 v2
  # 1:  4  3
  # 2:  6  5
  # 3:  8  2
  # 4:  3  1
  # 5:  7  4
  </code></pre>