<meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="border-collapse: collapse; color: rgb(51, 51, 51); font-family: arial, sans-serif; font-size: 13px; ">Hello All,<div>

<br></div><div>I just started using data.table and like some of the features. I apologize if this is a basic question, but I can&#39;t find it posted on the list. I want to select the rows that don&#39;t match a key.</div>

<div><br></div><div>For example, in data.frame i&#39;d do:</div><div><br></div><div><div>DF = data.frame(x=1:3,y=4:6,z=7:9)</div></div><div>ds &lt;- c(1,2)</div><div>new.DF &lt;- DF[which(! DF$x %in% ds),]</div><div><br>
</div>
<div>where, ds is a vector of values that I don&#39;t want matched. So, new.DF would just consist of the third row.</div><div><br></div><div>How do I do something comparable with data.table?</div><div><br></div><div>I have:</div>

<div>DT = data.table(DF)</div><div>setkey(DT,x)</div><div>and then I know I can select ds, by:</div><div>DT[ds]</div><div>but something like:</div><div>DT[!ds] obviously doesn&#39;t work...</div><div><br></div><div>Thanks,</div>

<div><br></div><font color="#888888"><div>Ben</div></font></span>