title: Select columns in a data.table using vector of characters
body: <p>I am trying to select some columns from a <code>data.table</code> but getting unexpected results.</p>
  <p>For the following, I want to select columns <code>y</code> and <code>z</code> and this works as expected</p>
  <pre><code>library(data.table)
  dt &lt;- data.table(x=1:4, y=5:8, z=9:6)
  dt[, c(&quot;y&quot;, &quot;z&quot;)]
  </code></pre>
  <p>When I try to do this using <code>setdiff</code> it returns nonsense</p>
  <pre><code>omit_var &lt;- &quot;x&quot;
  dt[, setdiff(c(&quot;x&quot;,&quot;y&quot;,&quot;z&quot;), omit_var)]
  
  </code></pre>
  <p>Even though they are equivalent <code>all.equal(setdiff(c(&quot;x&quot;,&quot;y&quot;,&quot;z&quot;), omit_var), c(&quot;y&quot;, &quot;z&quot;))</code></p>
  <p>Why is this happening -- I guessing a scoping issue but can I avoid it while keeping the code similar?</p>
  <p>(I realise I can do <code>i &lt;- setdiff(c(&quot;x&quot;,&quot;y&quot;,&quot;z&quot;), omit); dt[,..i]</code>)</p>