Hello!

I have a string x:
x <- c("x - 84", "y - 293.04", "z = 12.5")

I want to remove all the non-numeric stuff from it. The following works:
gsub("[^0-9]", "", x)

However, it strips my numbers of "."

Help - how could I do the same but leave the "." in?

Thanks a lot!

-- 
Dimitri Liakhovitski

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to