I have two dataframes of single column gene lists that have some overlapping/duplicated values. I am looking to basically find genes that are only present in DF1 and not in both DF1 and DF2.
**DF1** **DF2**
ABCD1 ABCD1
ACSL4 ACTC1
ACVRL1 ADNP
AFF2 AFF2
How do I merge these 2 such that the result will only give me non-overlapping results from DF1 in a new Dataframe such that:
**DF3**
ACSL4
ACVRL1
So far I have just used rbind to combine DF1 and DF2 and then try to get rid of duplicates using
DF3 <- rbind(DF1, DF2)
DF3[!duplicated(DF3) | duplicated(DF3, fromLast=TRUE)),, drop = FALSE]
This seems to work okay but are there better ways to do this?