Delete duplicate rows in two columns simultaneously [duplicate]

二次信任 提交于 2019-11-27 15:34:03

If you want to use subset, you could try:

  subset(df, !duplicated(subset(df, select=c(allrl, RAW.PVAL))))
 # RAW.PVAL GR allrl  Bak
 #1     0.05 fr   EN1  B12
 #3     0.45 fr   EN2  B10
 #4     0.35 fg   EN2 B066

But, I think @thelatemail's approach would be better

  df[!duplicated(df[c("RAW.PVAL","allrl")]),]
Bharathi

Use unique() to remove the duplicate values.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!