ccc8_ccc1_fff11 8 1 11
#3: hhh15_ggg2_hhh13 15 2 13
#4: fff9_bbb3_ccc9 9 3 9
#5: ggg4_eee2_jjj14 4 2 14
#6: jjj7_ddd9_bbb15 7 9 15
A.K.
____________
From: Dimitri Liakhovitski
To: arun
Cc: R help
Sent: Saturday, June 8, 2013 5:59 PM
Subject: Re: [R] splitting a string colu
g2_jjj14 12 2 14
>> #2 ccc7_ddd15_aaa11 7 15 11
>> #3 hhh12_ddd14_fff12 12 14 12
>> #4 fff11_bbb15_aaa6 11 15 6
>> #5 ggg12_ccc9_ggg8 12 9 8
>> #6 jjj8_eee12_eee4 8 12 4
>>
>> A.K.
>>
>>
>> - Original Message -
>> From: arun
>&g
jjj14 12 2 14
> #2 ccc7_ddd15_aaa11 7 15 11
> #3 hhh12_ddd14_fff12 12 14 12
> #4 fff11_bbb15_aaa6 11 15 6
> #5 ggg12_ccc9_ggg8 12 9 8
> #6 jjj8_eee12_eee4 8 12 4
>
> A.K.
>
>
> - Original Message -
> From: arun
> To: Dimitri Liakhovitski
> Cc: R he
arun
To: Dimitri Liakhovitski
Cc: R help
Sent: Friday, June 7, 2013 11:00 PM
Subject: Re: [R] splitting a string column into multiple columns faster
HI,
May be this helps:
res<-data.frame(x=x,read.table(text=gsub("[A-Za-z]","",x[,1]),sep="_",header=FALSE),strings
HI,
May be this helps:
res<-data.frame(x=x,read.table(text=gsub("[A-Za-z]","",x[,1]),sep="_",header=FALSE),stringsAsFactors=FALSE)
res
# x V1 V2 V3
#1 aaa1_bbb1_ccc3 1 1 3
#2 aaa2_bbb3_ccc2 2 3 2
#3 aaa3_bbb2_ccc1 3 2 1
A.K.
- Original Message -
From: Dimitri Liakho
5 matches
Mail list logo