Skip to content
Prev 164154 / 398506 Next

Selecting rows that are the same in separate data frames

Thanks for reply.

What I want is the equivalent of this :

xxx = 1:10
which(xxx %in% c(2,5))


.......but where there is more than one criterion for matching.


which (b %in% a) in the code I included does nothing (not surprisingly).

I'm not sure that I can use merge, because I want the whole of a, but to
mark those rows which are also in b. If I do merge ( a,b ),  I just get b.
If I do merge ( a,b, all.x =TRUE), I get a.
bartjoosen wrote: