esearch Department
Naval Postgraduate School
SEED Center web site: http://harvest.nps.edu
-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Berend Hasselman
Sent: Friday, September 18, 2015 1:30 AM
To: Dimitri Liakhovitski
Cc: r-help
Subject: Re: [R] Hep w
web site: http://harvest.nps.edu
>
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Berend
> Hasselman
> Sent: Friday, September 18, 2015 1:30 AM
> To: Dimitri Liakhovitski
> Cc: r-help
> Subject: Re: [R] Hep with regex! - combina
For the last one, looks like this one works:
x[grep("^(q10|q12).*\\_1$", x)]
On Thu, Sep 17, 2015 at 5:46 PM, Dimitri Liakhovitski
wrote:
> Duncan,
> Of course my verbal descriptions and my code don't match my regexp -
> otherwise I wouldn't be asking the
On 17/09/2015 5:11 PM, Dimitri Liakhovitski wrote:
> (x <- c("q10_1", "q10_2", "q10_11", "q12_1", "q12_2", "q13_1", "q13_11"))
>
> # Which strings start with "q10" or "q12? - WORKS
> x[grep("^q10|q12", x)]
>
> # Which strings end with "1"? - WORKS
> x[grep("1$", x)]
>
> # Which strings end with
On Sep 17, 2015, at 2:11 PM, Dimitri Liakhovitski wrote:
> (x <- c("q10_1", "q10_2", "q10_11", "q12_1", "q12_2", "q13_1", "q13_11"))
>
> # Which strings start with "q10" or "q12? - WORKS
> x[grep("^q10|q12", x)]
>
> # Which strings end with "1"? - WORKS
> x[grep("1$", x)]
>
> # Which strings
(x <- c("q10_1", "q10_2", "q10_11", "q12_1", "q12_2", "q13_1", "q13_11"))
# Which strings start with "q10" or "q12? - WORKS
x[grep("^q10|q12", x)]
# Which strings end with "1"? - WORKS
x[grep("1$", x)]
# Which strings end with "_1"? - WORKS
x[grep("\\_1$", x)]
# Which strings start with "q10"
Duncan,
Of course my verbal descriptions and my code don't match my regexp -
otherwise I wouldn't be asking the question, would I?
Please assume my verbal descriptions are correctly describing what I want.
Thank you!
On Thu, Sep 17, 2015 at 5:42 PM, Duncan Murdoch
On 17/09/2015 5:46 PM, Dimitri Liakhovitski wrote:
> Duncan,
> Of course my verbal descriptions and my code don't match my regexp -
> otherwise I wouldn't be asking the question, would I?
> Please assume my verbal descriptions are correctly describing what I want.
Sorry, I interpreted "works" and
> On 17 Sep 2015, at 23:11, Dimitri Liakhovitski
> wrote:
>
> (x <- c("q10_1", "q10_2", "q10_11", "q12_1", "q12_2", "q13_1", "q13_11"))
>
> # Which strings start with "q10" or "q12? - WORKS
> x[grep("^q10|q12", x)]
>
> # Which strings end with "1"? - WORKS
>
9 matches
Mail list logo