From tlumley at u.washington.edu  Mon Oct 23 16:54:23 2006
From: tlumley at u.washington.edu (Thomas Lumley)
Date: Mon, 23 Oct 2006 07:54:23 -0700 (PDT)
Subject: [Rd] Changing function arguments
In-Reply-To: <67DCA285A2D7754280D3B8E88EB5480211DDA481@MSGBOSCLB2WIN.DMN1.FMR.COM>
References: <67DCA285A2D7754280D3B8E88EB5480211DDA481@MSGBOSCLB2WIN.DMN1.FMR.COM>
Message-ID: <Pine.LNX.4.64.0610230753420.29706@homer21.u.washington.edu>

On Sun, 22 Oct 2006, McGehee, Robert wrote:

> R-Developers,
> I'm looking for some help computing on the R language.
>
> I'm hoping to write a function that parses a language or expression
> object and returns another expression with all instances of certain
> argument of a given function altered. For instance, say I would like my
> function, myFun to take an expression and whenever the argument 'x'
> appears within the function FUN inside that expression, return an
> altered expression in which 'x' is incremented by one.
>

This sort of recursive parsing and modification is done by the bquote() 
function, so you could look there.

     -thomas

Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle




[Rd] Changing function arguments
Thomas Lumley