Re: [R] how to parse out string separated by special character

2010-06-07 Thread Greg Snow
n...@r- > project.org] On Behalf Of xin wei > Sent: Monday, June 07, 2010 11:21 AM > To: r-help@r-project.org > Subject: [R] how to parse out string separated by special character > > > hi, everyone: > i have a data frame with one single character column as follo

Re: [R] how to parse out string separated by special character

2010-06-07 Thread Henrique Dallazuanna
Try this: gsub(".*_(.*)_.*_.*", "\\1", s) On Mon, Jun 7, 2010 at 2:21 PM, xin wei wrote: > > hi, everyone: > i have a data frame with one single character column as followings: > DS_xxx_yyy_24hr_zzz_1 > DS_xxx_yyy_24hr_zzz_2 > DS_xxx_yyy_24hr_zzz_3 > DS_xxx_yyy_24hr_zzz_4 > DS_xxx_yyy_24hr_zz

[R] how to parse out string separated by special character

2010-06-07 Thread xin wei
hi, everyone: i have a data frame with one single character column as followings: DS_xxx_yyy_24hr_zzz_1 DS_xxx_yyy_24hr_zzz_2 DS_xxx_yyy_24hr_zzz_3 DS_xxx_yyy_24hr_zzz_4 DS_xxx_yyy_24hr_zzz_1 DS_xxx_yyy_24hr_zzz_2 DS_xxx_yyy_24hr_zzz_3 DS_xxx_yyy_24hr_zzz_4 DS_xxx_yyy_24hr_zzz_1 i need to parse o