Newbie to R here. Been searching this forum to try and find a way to search for text within a string in the same row of data. I've used grepl before, but I can't get it to look down a column and apply the check for each row. I feel like this is an easy solution, but I've spent a few hours on it and can't seem to get it.
Basically I have something like column 1 below and need it to check if the text in column 2 is within column one, then return true or false in a new column.
column 1 column2 result
Target_US_Toy _US_ TRUE
Target_CA_Toy _MX_ FALSE
Target_NZ_Toy _NZ_ TRUE
Thank you!