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

node.js - How to mock a third-party api calls in the backend -

java - Could not locate OpenAL library -

Non Unique Username with ASP.Net Identity 2.0 -