Skip to content
Prev 274820 / 398506 Next

translating a character string

On 19/10/11 13:57, Erin Hodgess wrote:
Irrespective of fortune("parse"), parse() is what you need:

f1 <- "(1/30)*(20-x)"
x <- 42
y <- eval(parse(text=f1))
y
[1] -0.7333333

     cheers,

         Rolf