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(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]]))
> 

Another way is to use update, e.g.

> fo <- y ~ x
> update(fo, transform(.) ~ .)
transform(y) ~ x

______________________________________________
R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to