On Fri, Nov 26, 2010 at 8:48 AM, Søren Højsgaard
<[email protected]> wrote:
> Thanks, but I think there is a small mistake in your code:
>
>> expr <- expression(a+b+c)
>> do.call("substitute", list(expr, list(a=1)))
> expression(a + b + c)
>
> I think it should be:
>> as.expression(do.call("substitute", list(expr[[1]], list(a=1))))

Its already an expression so the extra as.expression would serve no purpose:

> identical(as.expression(do.call("substitute", list(expr, list(a=1)))),
+ do.call("substitute", list(expr, list(a=1))))
[1] TRUE





-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to