[R] Parenthesis recognition with grep
pomchip at free.fr
Sun Aug 31 16:28:50 CEST 2008
I need to dynamically recognize the index of a given string myStr in a
vector of string. The problem is that myStr might contain parenthesis,
causing grep not to recognize it the way I want (see below). The help
mentions that the pattern used by grep should be in the POSIX format...
I guess the problem is here; unfortunately, I am not familiar with the
subtleties of the POSIX format
myStr <- "YD(001)"
headers <-c("TD", "YD(001)", "YD(002)", "T", "Y(001)", "Y(002)")
How should I modify my grep call to get the match right?
Thank you for your help,
More information about the R-help