I left out the brackets in my last email but the problem (a reappears after have been substituted out) still remains:
> z <- substitute( function(){a+1}, list(a=quote(b)) ) > z function() { b + 1 } > eval(z) function(){a+1} --- Date: Wed, 17 Mar 2004 20:10:43 -0500 (EST) From: Gabor Grothendieck <[EMAIL PROTECTED]> [ Add to Address Book | Block Address | Report as Spam ] To: <[EMAIL PROTECTED]> Subject: [R] substitute question Consider the following example: # substitute a with b in the indicated function. Seems to work. > z <- substitute( function()a+1, list(a=quote(b)) ) > z function() b + 1 # z is an object of class call so use eval # to turn it into an object of class expression; however, # when z is evaluated, the variable a returns. > eval(z) function()a+1 Why did a suddenly reappear again after it had already been replaced? ______________________________________________ [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