[R] looking for a string

[Ricardo Rodriguez] Your XEN ICT Team webmaster at xen.net
Tue Apr 15 02:49:40 CEST 2008


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



More information about the R-help mailing list