I 2nd the reprex request. That with a minimal sample dataset will be very helpful in addressing your question.
Could you also clarify; it sounds like your have a variables/columns named abcdef, defgh, and bcdfeg, and you want to only return the row in which values in that variable are exactly equal to def, does that sound right?
I’d check out the options in dplyr’s filter function for combining multiple statements, and lookup the stringr package and the str_detect function
You are partly correct. Those examples are not column names but the Column values. I want my codes to return values under column "Site" which contain "def" for example it should match value "abcdef", "defgh", "bcdefg" but NOT "abc", "bcdfg", "deghij" or "efghi".
This is a sample of values in column "Site" (ignore the line number):