Skip to content
Prev 278745 / 398502 Next

Transforming a string into a command

On 11/29/2011 06:30 PM, Xu Wang wrote:
Hi Xu,

Try:

s<-"log(a+b)"
a<-1
b<-2
eval(parse(text=s))
[1] 1.098612

There is no "ln" function in the base package.

Jim