title: R data.table function to copy a value based on a reference column number on the same row
body: <p>I have a data.table that looks like this:</p>
  
  <pre><code>| key | zone_1 | zone_2 | zone_3 |  v1  |  v2  |
  |  A  |   4.3  |   6.9  |   12.0 |   2  |      |
  |  B  |   3.7  |   5.2  |    9.7 |   4  |      |
  </code></pre>
  
  <p>I need a function that will copy the value of the column referenced in v1 to v2 for each row, so it will look like this:</p>
  
  <pre><code>| key | zone_1 | zone_2 | zone_3 |  v1  |  v2  |
  |  A  |   4.3  |   6.9  |   12.0 |   2  |  4.3 |
  |  B  |   3.7  |   5.2  |    9.7 |   4  |  9.7 |
  </code></pre>