Re: [R] Removing any text beginning with...

2009-05-11 Thread jim holtman
Is this what you want (using regular expressions): > x <- "ENSG /// ENSGy /// ENSG" > sub("^([[:alpha:]]+).*", "\\1 ", x) [1] "ENSG" > On Mon, May 11, 2009 at 9:01 AM, Amélie Baud wrote: > Hi ! > > >From an Ensembl annotation like ENSG /// ENSGy /// ENSG, I am > tr

[R] Removing any text beginning with...

2009-05-11 Thread Amélie Baud
Hi ! >From an Ensembl annotation like ENSG /// ENSGy /// ENSG, I am >trying to keep only the first part: ENSG. I wasn't able to find any >helpful information about how to do it. Could you help me with that please ? >Is the use of the equivalent to the Excel * (any text) a good w