From tlumley at u.washington.edu  Thu Apr 21 01:47:12 2005
From: tlumley at u.washington.edu (Thomas Lumley)
Date: Thu Apr 21 01:47:28 2005
Subject: [Rd] Suggestions for manipulating formula objects
In-Reply-To: <33078.136.177.22.105.1114027536.squirrel@webmail.fpcc.net>
References: <33078.136.177.22.105.1114027536.squirrel@webmail.fpcc.net>
Message-ID: <Pine.A41.4.61b.0504201644290.71116@homer07.u.washington.edu>

On Wed, 20 Apr 2005 rlee@fpcc.net 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 way to accomplish this?

One way is

formula[[2]]<-substitute(transform(y),list(y=formula[[2]]))


 	-thomas


[Rd] Suggestions for manipulating formula objects
Thomas Lumley