2

I have a general form for a data.table query where I can subset my data to only look at values that match the %like% statement, it looks like

DT[Var %like% "x|y|z", .N,]

And for the general operators for excluding values

i = x != "somevalue",

How can I combine these to ignore values that sound %like% some value and only return a set that don't match these requests.

The context here is a large database of customer data and trying to remove unwanted data so this list is much smaller than the list I am interested in.

4

1 回答 1

10

我想你正在寻找

DT[!(var %like% 'expr')]

有关其他逻辑运算符的信息可以在同一帮助页面上找到;?`!`在控制台中输入以打开它。

于 2013-10-03T02:30:49.373 回答