I have this line in R:
numbers <- "4 4956 1.00e-09 50.9 1.244 47.1 1.04 5.5 0.499 13.9 0"
and I have to read numbers into a vector. Now I could find the same topics for other languages, but not for R here. I tried:
library(stringr) str_extract_all(numbers, "[0-9]+") [[1]] [1] "4" "4956" "1" "00" "09" "50" "9" "1" "244" "47" "1" [12] "1" "04" "5" "5" "0" "499" "13" "9" "0"
but it fills in the numbers, as you can see above. I think the problem is expressing regular expressions, but it seems that I cannot get it right, and in fact I have no idea.
I appreciate any comments.
source share