Let's assume two dataframes: A and B.
Dataframe: A Dataframe: B
ColA1 ColA2 ColB1 ColB2
| Dog | Peter| | Lion | Bob |
| Lion | Bob | | Cat | NA |
| Zebra | Jim | | Tiger| NA |
| Bat | Robin| | Dog | Peter |
I want to to do this:
B$ColB2 <- ifelse((B$ColB1 %in% A$ColA1), "Name from col A" , NA)