I have a 'named expression' like
  expr <- expression(rep(1,d))
and would like to replace the argument d with say 5 without actually evaluating 
the expression. So I try  substitute(expr, list(d=5)) in which case R simply 
returns expr which when I 'evaluate' it gives
 eval(expr)
 Error in rep.default(1, d) : invalid number of copies in rep()

I've looked at ?substitute and ?expression (and other places) for ideas, but - 
well I guess there are some details which I haven't quite understood. Can 
anyone point me in the right direction?
Thanks
Søren

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to