更新时间:2023-11-28 23:47:46
另一种选择是按行对列Var1
和Var2
进行排序,然后应用duplicated
.
Another option would be to sort columns Var1
and Var2
rowwise and then apply duplicated
.
idx <- !duplicated(t(apply(dat[c("Var1", "Var2")], 1, sort)))
dat[idx, ]
# Var1 Var2 value
#1 ABC BCD 0.5
#2 DEF CDE 0.3