There is also a stringr/piped approach, which works much the same as @williaml's answer:
vec = "49.0 50.2 50.5 48.5 47.5 44.5 28.0 31.5 34.5 35.0 38.0 38.5 15.0 17.0 20.5 29.5" |>
stringr::str_replace_all(" ", ", ") |>
stringr::str_split(pattern = ", ", simplify = T) |>
as.numeric()
If you encounter this situation a lot, you could even wrap it up in a function:
deparse_vector = function(vec, delim = " "){
vec |>
stringr::str_replace_all(delim, ", ") |>
stringr::str_split(pattern = ", ", simplify = T) |>
as.numeric()
}
deparse_vector("49.0 50.2 50.5 48.5 47.5 44.5 28.0 31.5 34.5 35.0 38.0 38.5 15.0 17.0 20.5 29.5")