I have two lists:
a <- c(\"da\", \"ba\", \"cs\", \"dd\", \"ek\") b <- c(\"zyc\", \"ulk\", \"mae\", \"csh\", \"ddi\", \"dada\")
I want
We can paste the 'a' elements to a single string with | as the delimiter, use that as pattern in grepl, negate (!) to subset 'b'.
paste
|
pattern
grepl
!
b[!grepl(paste(a, collapse="|"), b)]