I'm sure the answer to this probably exists out there somewhere, but I'm struggling to find it.
I have a set of strings that are retail outlet names and I am trying to identify any that match certain patterns
With the below code I can relatively easily subset where the single name of outlet 1 ["example"] appears, but am unable to 'match' outlet 2, which consists of two words separated by a space ["example two"].....
des <- subset(poiSep06,
grepl("example|example two", tolower(poiSep06$NAME)) == TRUE)
The above brings back all records where the name includes "example", but does not bring back anything for "example two".
Can anyone advise/point me in the direction of something to show me what I'm doing wrong [I'm sure it's pretty simple]. I'm reluctant to manipulate the original NAME values too much as it might lead to erroneous outlets being included.