data.table in r : subset using column index
<p>DT - data.table with column "A"(column index==1), "B"(column index 2), "C" and etc</p>

<p>for example next code makes subset DT1 which consists rows where A==2:</p>

<pre><code>DT1 &lt;- DT[A==2, ]
</code></pre>

<p>BUT How can I make subsets like DT1 using only column index??</p>

<p>for example, code like next not works :</p>

<pre><code>DT1 &lt;- DT[.SD==2, .SDcols = 1]
</code></pre>