[R] Replacement in an expression - can't use parse()

Thomas Lumley tlumley at u.washington.edu
Tue Mar 27 19:02:03 CEST 2007


On Tue, 27 Mar 2007, Peter Dalgaard wrote:

>The way around this is to add a further layer of substitute() to insert
>the value of e:

>> eval(substitute(substitute(call,list(u2=quote(x),u3=1)),list(call=e[[1]])))
> u1 + x + 1

Or eval(do.call(substitute, list(e[[1]], list(u2=quote(x),u3=1)))

 	-thomas



More information about the R-help mailing list