r - How to turn quoted string input into value of a vector? -
i accept input user in format such as:
arg_from_user = "c(1,2,3)"
and assign content of string vector, such that:
vector = mystery_function(arg_from_user) vector [1] 1 2 3
what use in place of mystery_function
?
you try
eval(parse(text="c(1,2,3)"))
Comments
Post a Comment