I want to remove the rows that are duplicated, for example if A==B and B==A, I want to keep just one of it. I have a dataframe looks like this:
|A |B |
|-------|-------|
|A1CF |APOBEC1|
|A1CF |KHSRP |
|A1CF |SYNCRIP|
|APOBEC1|A1CF |
|SYNCRIP|A1CF |
and my expected output is like this:
|A |B |
|-------|-------|
|A1CF |APOBEC1|
|A1CF |KHSRP |
|A1CF |SYNCRIP|
I have tried these,but it doesn't work.
df[!duplicated(df[,c("A","B")]),]