[R] Pattern match

Milan Bouchet-Valat nalimilan at club.fr
Wed Mar 20 17:56:50 CET 2013


Le mercredi 20 mars 2013 à 21:58 +0530, Christofer Bogaso a écrit :
> Hello again, in the help page of grep() function, it is written that
> 
> pattern:
> 
>  character string containing a regular expression (or character string
> for fixed = TRUE) to be matched in the given character vector. Coerced
> by as.character to a character string if possible. If a character
> vector of length 2 or more is supplied, the first element is used with
> a warning. Missing values are allowed except for regexpr and gregexpr.
> 
> But I have a vetcor of length '(> 1)' for the pattern match, and I
> need to have approximate match.
> 
> Is there any function similar to grep() to handle that?
Could you provide a reproducible example? One common solution is to
create pattern like "A|B" to match "A" or "B".


Regards

> Thanks for your help.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list