[Rd] Changing function arguments

Thomas Lumley tlumley at u.washington.edu
Mon Oct 23 16:54:23 CEST 2006


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




More information about the R-devel mailing list