Displaying 1 result from an estimated 1 matches for "str2expr".
Did you mean:
stmtexpr
2010 Oct 31
2
transfer string to expression
Dear all:
when I use parse() there is some problems. Below is an example:
b0<-1
b1<-1
x<-1
str2expr<-function(x){eval(parse(text=x))}
test1<-"b0+b1*sqrt(x)"
test2<-"b0+b1"
str2expr(test1)
str2expr(test2)
it can work well for test2 but not for test1.
Could you tell me how to fix this problem or is there other more stable
method to transfer an string to expression?
b...