Problem: I have a filtered data frame that contains columns containing unique values that identify participants. I wish to use these values (rank) in df1 to create a new column in df2 - where values will = 1 when the rank values match. Both df1 and df2 contain unique values for rank that can identify participants. However, I am not sure what function to use. Usually, case_when() might work, but this is going between data frames.
Ideal outcome: df2 will end up with a new column that looks like
fellow 0 0 1 1 0 0 1 1
Note: Apologies in advance if my question needs some work re formatting.
Many thanks in advance!