Is there anyway to get unique relation between two columns X and Y using R. I need to check if two way relationship exist between X and Y and eliminate if rows if present.
df <- data.frame(X = c("A", "B" ,"C","E","F","G" ), Y = c("E" ,"F", "G" ,"A","B","C") )
> df
X Y
1 A E
2 B F
3 C G
4 E A
5 F B
6 G C
I want to get output as below
> X Y
A E
B F
C G