I have two columns id1 and id2 which have interconnected list of id\'s. I am looking for a solution in R that can pull those id\'s together based on their relationship. E.g.