How to match columns in R and extract value. As an example: I want to match on the basis of Name and City columns of dataframe_one with dataframe_two and then return the output with two another column temp and ID. If it matches it should return TRUE and ID too.
My input is:
dataframe_one
Name    City
Sarah   ON
David   BC
John    KN
Diana   AN
Judy    ON
dataframe_two
Name    City    ID
Dave    ON     1092
Diana   AN     2314
Judy    ON     1290
Ari     KN     1450
Shanu   MN     1983
I want the output to be
Name    City    temp    ID
Sarah   ON   FALSE     NA
David   BC   TRUE     1450
John    KN   TRUE     1983
Diana   AN   FALSE    NA
Judy    ON   FALSE    NA
 
     
    