Say, for example, you have the following string:
"(1+1)*2"
And you want to transform it to its actual value (4, which comes from evaluating the equation in the string) in numeric.
I've trayed several ways, using eval()
or as.formula()
, but haven't figured it out yet. Any guess?