An example:
> df1
c1 c2 c3
1 2 3 8
2 1 6 2
3 2 9 8
I want to get a subset where c1 and c3 values are the same, so in this example I would like the result to be:
c1 c2 c3
1 2 3 8
3 2 9 8
Is there any straightforward way to do this in R? Thanks.