title: Sub-assign by reference on vector in R
body: <p>Can I use sub-assign by reference on atomic vectors somehow?<br>
  Of course without wrapping it in 1 column data.table to use <code>:=</code>.</p>
  
  <p></p>
  
  <pre><code>library(data.table)
  N &lt;- 5e7
  x &lt;- sample(letters, N, TRUE)
  X &lt;- data.table(x = x)
  upd_i &lt;- sample(N, 1L, FALSE)
  system.time(x[upd_i] &lt;- NA_character_)
  #    user  system elapsed 
  #    0.11    0.06    0.17 
  system.time(X[upd_i, x := NA_character_])
  #    user  system elapsed 
  #    0.00    0.00    0.03 
  </code></pre>
  
  <p>If R6 can help on that I'm open for R6 solution as it is one of my dep already.<br>
  I've already checked that <code>&lt;-</code> inside <code>R6</code> object still makes copy: <a href="https://gist.github.com/jangorecki/3ee84cb9648053cdacd5">gist</a>.</p>