Concatenate without duplicates dataframe r
I have a dataframe where I would like to concatenate certain columns. My issue is that the text in these columns may or may not contain duplicate information. I would like to strip out the duplicates in order to retain only the relevant information. For example, if I had a data frame such as: Animal1 Animal2 Label 1 cat dog dolphin 19 2 dog cat cat 72 3 pilchard 26 koala 26 4 newt bat 81 bat 81 You can see that in row 2, 'cat' is contained in both columns 'Animal1' and 'Animal2'. In row 3, the number 26 is in both column 'Animal1' and 'Label'. Whereas in row 4, information that is in columns