I want to perform a left_join to add information from a different dataframe.
The data I'm using is somewhat fragmented, so I first created four columns to indicate whether the information matches one of the to-be-joined dataframe. This results in four TRUE-FALSE columns.
My question is if it would be possible to set the columns to be joined with, based on all the columns that are TRUE for that particular row? For example, if column A and column B are TRUE in the orignal dataframe, it should match with the columns A and B in the other dataframe.
I can imagine this is a bit of a complicated question, and I struggle a little to formulate everything correctly. That's why I can't provide a reproducible example, but I hope someone can still nudge me into the right direction.
Many thanks in advance!