📜  如何根据两列的组合去除重复项 - R 编程语言代码示例

📅  最后修改于: 2022-03-11 14:51:58.238000             🧑  作者: Mango

代码示例1
# example
df = expand.grid(A = c('a', 'b', 'c', 'd'),
                 B = c('a', 'b', 'c', 'd'))

# remove redundant combinations
df[!duplicated(data.frame(t(apply(df,1,sort)))),]