I am trying to find a function to match two data frames of different lengths for only one common column and create another column that indicates whether it found a match or not. So for example df1:
Name Position location francesca A 75 cristina B 36
And df2:
location Country 75 UK 56 Austria
And I would like to match the "Location", and the result is something like:
Name Position Location Match francesca A 75 1 cristina B 36 0
I tried with match function or with:
subset(df1, location %in% df2)
But that will not work.
Could you help me figure out how to do this?
source share