Extract string part from text in r -


i have text string such this: stoli 2.0 intel pav uma, phelps 1.0 intel pav_baytrail x360 , need extract part stoli 2.0 first 1 , phelps 1.0 second one.

could give me sufficient solutio, how that, please? thank in advance.

you can use gsub function need:

> x <- c("stoli 2.0 intel pav uma", "phelps 1.0 intel pav_baytrail x360") > gsub("(^.* [0-9]*\\.[0-9]*).*", "\\1", x, perl = t, ) [1] "stoli 2.0"  "phelps 1.0" 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -