From: Peter Dalgaard <[EMAIL PROTECTED]> > (The real pain in these examples is that substitute autoquotes its > expr argument. Therefore, when you want to modify an expression that > is already stored in a variable, you need an extra outer layer of > eval(substitute(...)) to poke the content of the variable into the > inner substitute. An "esub" function with standard evaluation > semantics would make this much easier.)
That is one of the frustrations of using substitute. The other is that even if you do perform two levels of substitute, as I have been trying, you still can't count on it working for an arbitrary unevaluated expression, as my examples show. Even putting aside the source attribute which is super confusing until you know about it, all the solutions that I can see to the problem I presented are ugly. (1) One can either pick apart the function using body, or (2) I assume one could convert the function to text and paste together the correct substitute command with the text of the function inserted in its argument. The quote mechanism works but is not applicable if all you have is the function itself (as you point out). This is sooo frustrating. Thanks to you, Tony and Thomas for all your help. ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html