I would like to subset data.table
using list of tuples (multiple columns) from another data.table
, but not sure how.
From subsetting using single column
DT1[col1 %in% DT2(col_1)]
what I tried was
DT1[c(col1, col2) %in% DT2(col_1, col_2)]
albeit not successful. The error is
i evaluates to a logical vector length 91369852 but there are 45684926
rows. Recycling of logical i is no longer allowed as it hides more
bugs than is worth the rare convenience. Explicitly use
rep(...,length=.N) if you really need to recycle.
Any ideas? If %in%
is not the correct method, how would you solve this problem?