From therneau at mayo.edu  Fri Apr 24 14:42:22 2015
From: therneau at mayo.edu (Therneau, Terry M., Ph.D.)
Date: Fri, 24 Apr 2015 07:42:22 -0500
Subject: [Rd] model.frames and update
In-Reply-To: <mailman.27.1429869606.22958.r-devel@r-project.org>
References: <mailman.27.1429869606.22958.r-devel@r-project.org>
Message-ID: <2f3a88$go6a0@ironport10.mayo.edu>

I've gotton some good responses; thanks for the input. I'll proceed with my repairs down 
another path.

An underlying question then is "if the model frame is near useless, as the responses 
indicate, then why do all the standard methods save it (lm, glm, ..)"?   I suspect the 
answer is that it helps hide (some of) the negative consquences of how formulas are scoped.

Terry T.



On 04/24/2015 05:00 AM, r-devel-request at r-project.org wrote:
> I started to complain about this sort of thing last month, at
>
> http://article.gmane.org/gmane.comp.lang.r.devel/37805
>
> I was speaking of updating more generally (which might change
> anything, not just the formula), but I complained that
>
>     * we could try to use the model frame (which is stored already),
> but there are issues with this (the basis of a whole separate rant)
> because the model frame stores something in between predictor
> variables and input variables. For example
>
>     d <- data.frame(y=1:10,x=runif(10))
>     names(model.frame(lm(y~log(x),data=d)))
>     ## "y" "log(x)"
>
> So if we wanted to do something like update to "y ~ sqrt(x)",
> it wouldn't work ...



[Rd] model.frames and update
Therneau, Terry M., Ph.D.