I checked different posts on this, but still couldn\'t figure out why this is not working:
c=c(\"HI\",\"NO\",\"YESS\")
grep(\"YES\",c,fixed=T)
[1] 3
<
This just means that you're matching a string rather than a regular expression, but the string can still be a substring. If you want to match exact cases only, how about
> x=c("HI","NO","YESS") #better not to name variables after common functions
> grep("^YES$",x,fixed=F)
integer(0)
Edit per @nicola: This works b/c ^
means beginning and $
end of string, so ^xxxx$
forces the entire string to match xxxx
.