So you want to remove all rows where uc001ikn.2
appears? If so,I think this will work:
Rgames> foo
[,1] [,2]
[1,] 1 7
[2,] 2 8
[3,] 3 9
[4,] 2 3
[5,] 4 1
[6,] 3 10
[7,] 5 11
[8,] 6 12
Rgames> foo[!duplicated(foo[,1])&!(foo[,2]%in%duplicated(foo[,1])),]
[,1] [,2]
[1,] 1 7
[2,] 2 8
[3,] 3 9
[4,] 5 11
[5,] 6 12
Where in your case, you'd operate on df$knowngene1
and df$knowngene2
columns.