【发布时间】:2018-12-11 12:41:10
【问题描述】:
我想使用来自另一个 data.table 的元组(多列)列表对 data.table 进行子集化,但不确定如何。
从使用单列的子集
DT1[col1 %in% DT2(col_1)]
我尝试的是
DT1[c(col1, col2) %in% DT2(col_1, col_2)]
虽然没有成功。错误是
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.
有什么想法吗?如果%in%不是正确的方法,你会如何解决这个问题?
【问题讨论】:
-
你能提供一个reproducible example吗?
标签: r datatable tuples subset where