Re: [R] looking for a string

From: Charles C. Berry <cberry_at_tajo.ucsd.edu>
Date: Mon, 14 Apr 2008 17:27:57 -0700

On Tue, 15 Apr 2008, [Ricardo Rodriguez] Your XEN ICT Team wrote:

> Hi all,
>
> I have not been able to find an answer to what is a simple question:
>
> conaguaMexicoSub <- subset(conagua, unidad == "Jalapa", select =
> c(equipo,X101:X309))
>
> This subset gives me all the rows from conagua where unidad is Jalapa.
> But, please, how do I get all the rows where unidad contents Jalapa?
>
> I've been looking at regex, but I didn't find how pass one to unidad ==.

You want

         ?regexpr

Something like

         regexpr("Jalapa", as.character( unidad ) ) != -1

HTH, Chuck
>
> Thanks!
>
> --
> Ricardo Rodríguez
> Your XEN ICT Team
>
> ______________________________________________
> 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.
>

Charles C. Berry                            (858) 534-2098
                                             Dept of Family/Preventive Medicine
E mailto:cberry_at_tajo.ucsd.edu	            UC San Diego
http://famprevmed.ucsd.edu/faculty/cberry/ La Jolla, San Diego 92093-0901



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. Received on Wed 16 Apr 2008 - 00:18:15 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 16 Apr 2008 - 03:30:29 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.

list of date sections of archive