I have a data frame in R as follows.
IP1 IP2 No packet
X Y 8017
Z A 5019
Y B 8017
I want to print the values that occur in both the IP1 and IP2 column. For instance, in the above example Y. How do I do that in R?