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

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -