When I run the below 4 lines of code I dont get the same result from all 4. Why is the last line not finding a match?
grep("CPA's", c("CPA's"))
agrep("CPA's", c("CPA's"))
grep("CPA'?s?", c("CPA's"))
agrep("CPA'?s?", c("CPA's"))
I haven't yet done my full reading on the fuzzy matching functions, but on the face of it I don't see why this would be an issue.
Because the difference is more than the default
max.distancewhich is 0.1. Increase themax.distanceand it will capture it.To treat pattern as regular expression, select
fixed = FALSEwhich will then work directly