Re: [R] numbers as part of long character

2008-06-12 Thread Charilaos Skiadas
On Jun 12, 2008, at 6:34 PM, Hua Li wrote: Thanks, Marc and Haris! I didn't know the values of the numbers beforehand, so the scan method won't work, but "[^+-\\d.]+" will do! And Haris, I didn't intend to keep the information of which number is B, which is C etc when asking the question,

Re: [R] numbers as part of long character

2008-06-12 Thread Hua Li
Oh, Sorry, Marc. The scan method does work! Hua --- On Thu, 6/12/08, Charilaos Skiadas <[EMAIL PROTECTED]> wrote: > From: Charilaos Skiadas <[EMAIL PROTECTED]> > Subject: Re: [R] numbers as part of long character > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED], r-h

Re: [R] numbers as part of long character

2008-06-12 Thread Hua Li
tedious way to do it (use strspilt and unlist over and over again, after I get the number). But if you have a easier way to do it, I'd like to know! Hua --- On Thu, 6/12/08, Charilaos Skiadas <[EMAIL PROTECTED]> wrote: > From: Charilaos Skiadas <[EMAIL PROTECTED]> > Subject

Re: [R] numbers as part of long character

2008-06-12 Thread Charilaos Skiadas
On Jun 12, 2008, at 5:06 PM, Marc Schwartz wrote: on 06/12/2008 03:46 PM Hua Li wrote: Hi, I'm looking for some way to pick up the numbers which are contained and buried in a long character. For example, outtree.new="(((B:1204.25,E:1204.25):7581.11,F:8785.36):8353.85,C: 17139.21);" num.char

Re: [R] numbers as part of long character

2008-06-12 Thread Marc Schwartz
on 06/12/2008 03:46 PM Hua Li wrote: Hi, I'm looking for some way to pick up the numbers which are contained and buried in a long character. For example, outtree.new="(((B:1204.25,E:1204.25):7581.11,F:8785.36):8353.85,C:17139.21);" num.char = unlist(strsplit(unlist(strsplit(unlist(strsplit

[R] numbers as part of long character

2008-06-12 Thread Hua Li
Hi, I'm looking for some way to pick up the numbers which are contained and buried in a long character. For example, outtree.new="(((B:1204.25,E:1204.25):7581.11,F:8785.36):8353.85,C:17139.21);" num.char = unlist(strsplit(unlist(strsplit(unlist(strsplit(unlist(strsplit(unlist(strsplit(outtre