I need to compare two columns which are in resulting data frame and those two columns are coming from a separate sources.
Now, I would like to compare them and have a resulting (tag) column based on their match.(YES or NO)
There are e_phone and Phones.
(ex. e_phone="881234567" and Phones="881234567; 665553331;")
They both can have multiple phone numbers separated by ";". Sometimes e_phone can have numbers like e_phone="0992767312; +550661234567". (which are more then 9 digit length)
- I need to compare last nine digits of every of available phone number from e_phone in the Phones.
I already cleared Phones column because it comes from the sql, but I am new at the R so I really appreciate anyone's help.
At the end I would like to have add to the resulting data frame just a column called e_phone_match with values "YES" (if any number from e_phone exists in Phones) and "NO" if there isn't any match.
something like
| Phones | e_phone | e_phone_match |
|---|---|---|
| 881234567; 665553331; | 881234567 | YES |