I want to convert a string with a formula to an object with the type language
in order to use it as a formula.
How can I accomplish this?
A short example, that shows the problem:
formula <- "(1 - sin(x^3)"
> typeof(formula)
[1] "character"
A working reference is
> typeof(quote(1 - sin(x^3)))
[1] "language"
Of course, I can't just write formula in quote:
> quote(formula)
formula
So, is there a way to convert a string in a vector to something that as the typeof language
?