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