I have two variables, Names1 and Names2, both consisting of certain names. A simplified e.g. is pasted below:
I would like to drop the names in Names1 which are not in Names2. So in this e.g. I want to drop BB, DD, EE. Would appreciate if you someone could provide guidance on doing so.
Names1 | Names2 |
AA | CC |
BB | AA |
CC | HH |
DD | FF |
EE | GG |
FF | |
GG | |
HH |
I would like to drop the names in Names1 which are not in Names2. So in this e.g. I want to drop BB, DD, EE. Would appreciate if you someone could provide guidance on doing so.
Comment