I've got two character vectors:
x = {"a", "b", "c", "kt"}
y = {"abs", "kot", "ccf", "okt", "kk", "y"}
I need to use x to remove entries from y so that only the strings that do not contain any of the x's entries remain, like this:
y = {"kot", "kk", "y"}
The code should work for any size of vectors x and y.
So far I've tried to use gsub and grepl but these only work with single strings. I've tried to create a loop to do this but the problem seems more difficult than I thought. And of course, the more sophisticated the solution is, the better, but you can assume that in this case the vectors x and y have up to 200 entries.