Re: [R] grep function with patterns list...

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Mon 16 Oct 2006 - 13:12:51 GMT

Try this:

> grep("b|c|d", letters, value = TRUE)
[1] "b" "c" "d"

On 10/16/06, Stéphane CRUVEILLER <scruveil@genoscope.cns.fr> wrote:
> Dear R-users,
>
> is there a way to pass a list of patterns to the grep function? I
> vaguely remember something with %in% operator...
>
>
> Thanks,
>
>
> Stéphane.
>
>
>
> --
> "La science a certes quelques magnifiques réussites à son actif mais
> à tout prendre, je préfère de loin être heureux plutôt qu'avoir raison."
> D. Adams
> --
> AGC website <http://www.genoscope.cns.fr/agc>
> Stéphane CRUVEILLER Ph. D.
> Genoscope - Centre National de Séquencage
> Atelier de Génomique Comparative
> 2, Rue Gaston Cremieux CP 5706
> 91057 Evry Cedex - France
> Phone: +33 (0)1 60 87 84 58
> Fax: +33 (0)1 60 87 25 14
> scruveil@genoscope.cns.fr
>
> ______________________________________________
> R-help@stat.math.ethz.ch 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.
>



R-help@stat.math.ethz.ch 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. Received on Tue Oct 17 04:51:32 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 16 Oct 2006 - 19:30:10 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.