Re: [R] looking for a string

From: Charles C. Berry <cberry_at_tajo.ucsd.edu>
Date: Tue, 15 Apr 2008 20:15:09 -0700

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

> 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...
>

Like this:

conaguaMexicoSub <- subset(conagua,

 	regexpr("Jalapa", as.character( unidad ) ) != -1
 		select = c(equipo,X101:X309))

But it looks like you have to sort out some issues concerning dueling locales first.

Chuck

  > 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.
>

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 - 03:18:25 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 - 13:30:30 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