How to create a new column with 1 values in df1 by matching for values in df2?

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!

I think you are describing a join operation

If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.