grep with special characters
You need to escape special characters twice, once for R and once for the regular expression:
grep('\\*', s)
Another option is to use fixed=TRUE
grep('*', s,fixed=TRUE)
You need to escape special characters twice, once for R and once for the regular expression:
grep('\\*', s)
Another option is to use fixed=TRUE
grep('*', s,fixed=TRUE)