title: R data.table setting values
body: <p>I'm trying to set the following data.tables px &amp; vol using the following code. (falling back to a slow for loop)</p>
  
  <pre><code>a=data.table(
    date_id = rep(seq(as.Date('2013-01-01'),as.Date('2013-04-10'),'days'),5),
    px =rnorm(500,mean=50,sd=5),
    vol=rnorm(500,mean=500000,sd=150000),
    id=rep(letters[1:5],each=100)
    )
  
  b=data.table(
    date_id=rep(seq(as.Date('2013-01-01'),length.out=600,by='days'),5),
    id=rep(letters[1:5],each=600),
    px=NA_real_,
    vol=NA_real_
    )
  
  setkeyv(a,c('date_id','id'))
  setkeyv(b,c('date_id','id'))
  </code></pre>
  
  <p>and the following approach doesn't work.</p>
  
  <pre><code>s = a[1,id]
  d = a[1,date_id]
  b[id == s &amp; date_id == d, list(names(b)[3:4])] &lt;- a[id == s &amp; date_id ==d, list(names(a)[2:3])]
  </code></pre>
  
  <p>It fails with the following code</p>
  
  <pre><code>Error in `[&lt;-.data.table`(`*tmp*`, id == s &amp; date_id == d, list(names(b)[3:4]),  : 
    j must be atomic vector, see ?is.atomic
  </code></pre>
  
  <p>What am I doing wrong and how do I set those values from one data.table to the other elementwise. The actual table has quite a few columns so writing them out by hand is not an option for me.</p>
  
  <p>Thanks</p>