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
Post a Comment