[R] splitting a string based on the last underscore

Dimitri Liakhovitski dimitri.liakhovitski at gmail.com
Fri Jul 29 18:08:43 CEST 2011

Hope you could help me split the strings.

I have a set of strings:


I need to extract from each string:

1. Its unique part that comes before the last "_", i.e.: "a1","a2","a3_bla".
2. The part that comes after the last "_" and before ".o" at the end,
i.e.: 2.5, 2.53, 1.

Thank you so much for your help!

Dimitri Liakhovitski

More information about the R-help mailing list