[R] splitting sample names

1Rnwb sbpurohit at gmail.com
Thu Aug 18 23:43:41 CEST 2011


I have a data frame like this
xx<-data.frame(cbind(Sample=c('Ctrl_6h','1+0_6h','1+200_6h','1+5k_6h','Ctrl_5K_6h','ConA_6h'),
                 IFIT1=c(24,25,24.7,24.5,24.2,24.8)))

grep('[[:digit:]]h',xx$Sample)

yy<-xx$Sample

strsplit(yy,"_")

I have to extract the time information separated by '_' in the sample names,
i tried grep and strsplit, it looks that i am not providing some information
correctly. I would appreciate if someone can point me to the correct way.
Thanks
Sharad

--
View this message in context: http://r.789695.n4.nabble.com/splitting-sample-names-tp3753712p3753712.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list