Re: [R] evaluate a expression

2009-05-02 Thread Ning Ma
Thank you and Sunder! On Sat, May 2, 2009 at 8:49 PM, ronggui wrote: >> eval(parse(text=expr)) > [1] 15 > > > 2009/5/2 Ning Ma : >> Hi, >> >> I am new to R. Can anyone tell me how to evaluate an expression stored >> in a string? >> such as: >>> expr <- "3*5" >> I want to get the result 15. >> >>

Re: [R] evaluate a expression

2009-05-02 Thread ronggui
> eval(parse(text=expr)) [1] 15 2009/5/2 Ning Ma : > Hi, > > I am new to R. Can anyone tell me how to evaluate an expression stored > in a string? > such as: >> expr <- "3*5" > I want to get the result 15. > > Thanks in advance. > > __ > R-help@r-projec

Re: [R] evaluate a expression

2009-05-02 Thread Sundar Dorai-Raj
Hi, Ning, Try: eval(parse(text = expr)) HTH, --sundar On Sat, May 2, 2009 at 5:39 AM, Ning Ma wrote: > Hi, > > I am new to R. Can anyone tell me how to evaluate an expression stored > in a string? > such as: >> expr <- "3*5" > I want to get the result 15. > > Thanks in advance. > > ___

[R] evaluate a expression

2009-05-02 Thread Ning Ma
Hi, I am new to R. Can anyone tell me how to evaluate an expression stored in a string? such as: > expr <- "3*5" I want to get the result 15. Thanks in advance. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do