title: change columns position in a data frame using a tab txt list in R
body: <p>Maybe this is a simple question, but I'm trying to change the position of columns in a data frame in R. I've got this data frame</p>
  
  <pre><code>TargetID   1065197   1005204     97610   1011789    101075   1002206
  cg00000029 0.4192448 0.4177188 0.4797760 0.4214448 0.5500357 0.5535228
  cg00000108 0.9191919 0.9358317 0.9428818 0.9397804 0.9293985 0.9495835
  cg00000109 0.8935743 0.9157031 0.8731022 0.8734130 0.9226335 0.8980497
  cg00000165 0.1387203 0.1699675 0.2031603 0.1683728 0.1822674 0.1623122
  cg00000236 0.7502784 0.7324294 0.7895553 0.7096000 0.7878484 0.7747281
  cg00000289 0.5698198 0.5864769 0.6527094 0.5058923 0.6033058 0.6524675
  </code></pre>
  
  <p>And I want to rearrange the positions using this tabulated text file, which indicates every pair of columns in order</p>
  
  <pre><code>101075 1005204
  97610 1002206
  1011789 1065197
  </code></pre>
  
  <p>So the result must be something like this</p>
  
  <pre><code>colnames(reordered_data_frame)
  TargetID 101075 1005204 97610 1002206 1011789 1065197
  </code></pre>
  
  <p>Any ideas?</p>