On Dec 21, 2018, at 2:51 AM, Martin Maechler <maechler at stat.math.ethz.ch> wrote:
William Dunlap via R-devel
on Thu, 20 Dec 2018 15:09:56 -0800 writes:
When formula() is applied to the output of model.frame()
it ignores the formula in the model.frame's 'terms'
attribute:
d <- data.frame(A=log(1:6), B=LETTERS[rep(1:2,c(2,4))],
C=1/(1:6),
D=rep(letters[25:26],c(4,2)), Y=1:6)
m0 <- model.frame(data=d, Y ~ A:B) formula(m0)
`attributes<-`(terms(m0), value=NULL)
This is in part because model.frame()'s output has class
"data.frame" instread of c("model.frame","data.frame"), as
SV4 did, so there are no methods for model.frames.
Is there a reason that model.frame() returns a data.frame
with extra attributes but no special class or is it just
an oversight?
May guess is "oversight" || "well let's keep it simple"
Do you (all readers) see situation where it could harm now (with
the 20'000 packages on CRAN+BIoc+...) to do as SV4 (S version 4) has been doing?
I'd be sympathetic to class()ing it.
Martin
Bill Dunlap TIBCO Software wdunlap tibco.com