I have a string from an external file:
"start=70 end=200 step=5"
In general: it could be any similar string with arbitrary number of parameters. To avoid @Martin Mächler 's ire, see also Evaluate expression given as a string: The input format is given, I cannot change it.
Here is my solution to make this a named vector, using the no-no-no-eval:
s = "start=70 end=200 step=5"
lazyeval::lazy_eval(paste0("c(", stringr::str_replace_all(s, " ", ","),")"))
# start end step
# 70 200 5
Any more safe, elegant or Martin-pleasing alternative?