Re: [R] looking for a string

From: [Ricardo Rodriguez] Your XEN ICT Team <webmaster_at_xen.net>
Date: Tue, 15 Apr 2008 02:49:40 +0200

Charles C. Berry wrote:
>
> You want
>
> ?regexpr
>
> Something like
>
> regexpr("Jalapa", as.character( unidad ) ) != -1
>
> HTH,
>
> Chuck

Please, look at this...

 > substringJalapa <- regexpr("Jalapa", as.character(conagua$unidad ) ) != -1
Hubo 50 o más avisos (use warnings() para ver los primeros 50)  > warnings()
Warning messages:
1: In regexpr("Jalapa", as.character(conagua$unidad)) ... :   string de entrada 1 es inválida en este locale 2: In regexpr("Jalapa", as.character(conagua$unidad)) ... :   string de entrada 2 es inválida en este locale 3: In regexpr("Jalapa", as.character(conagua$unidad)) ... :   string de entrada 3 es inválida en este locale

The error means something like "Input string 1 is not valid for this locale". Sorry, I am not able yet to control messages language.

I don't know how to pass regexpr(.........) to my problem...

conaguaMexicoSub <- subset(conagua, unidad == "Jalapa", select = c(equipo,X101:X309))

Please, could you help me with this? Thanks!

Best,

Ricardo

-- 
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.
Received on Wed 16 Apr 2008 - 02:48:33 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 - 04: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