How do I exclude columns from a data.table?
<p>I have a data.table, and want to exclude some set of columns. For example,</p>

<pre><code>library(data.table)
dt &lt;- data.table(a = 1:2, b = 2:3, c = 3:4, d = 4:5)
dt[ , .(b, c)]
</code></pre>

<p>Gives me the second and third column, b and c. How do I instead EXCLUDE columns b and c. Coming from the data.frame world, I would expect something like the following:</p>

<pre><code>dt[ , -.(b, c)]
</code></pre>

<p>or, maybe</p>

<pre><code>dt[ , !.(b, c)]
</code></pre>

<p>But neithr of these work. I know I can use </p>

<pre><code>dt[ , -c(2:3), with = FALSE]
</code></pre>

<p>but this just (as I understand it) casts the data.table as a data.frame and then uses the standard operations. I would like to avoid this, since it is a) kind of cheating, an b) gives up the speed boosts available in data.table. I reviewed the data.table FAQ, and the vignette, and cannot seem to find anything.</p>

<p>(I know this is all very simplistic, and I could just select the other two columns. However, this is a microcosm of a much, MUCH bigger data.table I am working with.)</p>