Say I have two tables:
library(data.table) set.seed(1) tab1 <- data.table( let = rep(letters[1:2], each = 3), num = rep(1:3, 2), val = rnorm(6),
In this case, it's equivalent to an anti join:
tab1[!tab2, on=c("let", "num")]
But setdiff() would only the first row for every let,num. This is marked for v1.9.8, FR #547.
setdiff()
let,num