[R] grep help (character ommission)

Rui Barradas ruipbarradas at sapo.pt
Wed May 1 13:42:00 CEST 2013


Hello,

The following pattern seems to do it.

grep("^Intensity$|^Intensity\\s[^HL]",
     c("Intensity","Intensity L", "Intensity H", "Intensity Rep1"))


Hope this helps,

Rui Barradas

Em 01-05-2013 09:37, Johannes Graumann escreveu:
> Hello,
>
> Banging my head against a wall here ... can anyone light the way to a
> pattern modification that would make the following TRUE?
>
> identical(
>    grep(
>      "^Intensity\\s[^HL]",
>      c("Intensity","Intensity L", "Intensity H", "Intensity Rep1")),
>    as.integer(c(1,4)))
>
> Thank you for your time.
>
> Sincerely, Joh
>
> ______________________________________________
> 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.
>



More information about the R-help mailing list