Re: [Rd] Suggestions for manipulating formula objects

2005-04-21 Thread Gabor Grothendieck
On 4/20/05, Thomas Lumley <[EMAIL PROTECTED]> wrote: > On Wed, 20 Apr 2005 [EMAIL PROTECTED] wrote: > > > I'm trying to manipulate/change a formula prior to passing it to another > > function. A simplified example: > > > > User passes formula to my function: y~x > > My function does: lm(transform

Re: [Rd] Suggestions for manipulating formula objects

2005-04-20 Thread Rich FitzJohn
Hi, Formulas (and other language objects) can be manipulated to some extent like lists (see the R Language Definition). A formula corresponds to a 3-element list, where the first argument is the function `~`, and the next two are the LHS and RHS of the formula, respectively (for unary use of ~, t

Re: [Rd] Suggestions for manipulating formula objects

2005-04-20 Thread Thomas Lumley
On Wed, 20 Apr 2005 [EMAIL PROTECTED] wrote: I'm trying to manipulate/change a formula prior to passing it to another function. A simplified example: User passes formula to my function: y~x My function does: lm(transform(y)~x) Here, transform() is added to the model's response. What is the best wa

[Rd] Suggestions for manipulating formula objects

2005-04-20 Thread rlee
I'm trying to manipulate/change a formula prior to passing it to another function. A simplified example: User passes formula to my function: y~x My function does: lm(transform(y)~x) Here, transform() is added to the model's response. What is the best way to accomplish this? ___