actually, I am thinking of strsplit().
On 3/9/07, Shawn Way <[EMAIL PROTECTED]> wrote:
> I have a set of character strings like below:
>
> > data3[1]
> [1] "CB01_0171_03-27-2002-(Sample 26609)-(126)"
> >
>
> I am trying to extract the text 03-27-2002 and convert this into a date for
> the sam
Try this:
library(gsubfn)
x <- "CB01_0171_03-27-2002-(Sample 26609)-(126)"
unlist(strapply(x, "..-..-"))
The gsubfn home page is at:
http://code.google.com/p/gsubfn/
On 3/9/07, Shawn Way <[EMAIL PROTECTED]> wrote:
> I have a set of character strings like below:
>
> > data3[1]
> [1] "CB01_01
I have a set of character strings like below:
> data3[1]
[1] "CB01_0171_03-27-2002-(Sample 26609)-(126)"
>
I am trying to extract the text 03-27-2002 and convert
this into a date for the same record. I keep looking
at the grep function, however I cannot quite get it to
work.
grep("\d\d-\d\d
On Fri, 2007-03-09 at 15:23 -0500, Shawn Way wrote:
> I have a set of character strings like below:
>
> > data3[1]
> [1] "CB01_0171_03-27-2002-(Sample 26609)-(126)"
> >
>
> I am trying to extract the text 03-27-2002 and convert this into a date
> for the same record. I keep looking at the g
.
Statistical Data Center
Intermountain Healthcare
[EMAIL PROTECTED]
(801) 408-8111
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Shawn Way
> Sent: Friday, March 09, 2007 1:12 PM
> To: r-help@stat.math.ethz.ch
> Subject: [R] Extr
I have a set of character strings like below:
> data3[1]
[1] "CB01_0171_03-27-2002-(Sample 26609)-(126)"
>
I am trying to extract the text 03-27-2002 and convert this into a date
for the same record. I keep looking at the grep function, however I
cannot quite get it to work.
grep("\d\d-\
I have a set of character strings like below:
> data3[1]
[1] "CB01_0171_03-27-2002-(Sample 26609)-(126)"
>
I am trying to extract the text 03-27-2002 and convert this into a date for
the same record. I keep looking at the grep function, however I cannot quite
get it to work.
g