[Rd] [EXTERNAL] Re: Fwd: Re: Re: backquotes and term.labels
Therneau, Terry M., Ph.D.
therneau at mayo.edu
Thu Mar 8 17:24:49 CET 2018
Ben,
I looked at the source code you pointed out, and the line
fr <- fr[attr(terms(fr),"varnames.fixed")]
sure looks to me as though the terms() function has returned an object with a
varnames.fixed attribute. Either that or your code has inside knowledge that a reader
like me won't know. Given what you said I will guess that terms(x) returns the terms
attribute of x if that already exists, doing no processing, and you know that fr has
already been thusly modified?
I have code that uses the variables, term.names, and factors attributes of the terms()
structure, and all of those have the backticks. I know the second two will currently
break the coxme and survival packages, I haven't chased down the effect on the first.
On 03/08/2018 08:42 AM, Ben Bolker wrote:
> Meant to respond to this but forgot.
>
> I didn't write a new terms() function -- I added an attribute to the
> terms() (a vector of the names
> of the constructed model matrix), thus preserving the information at
> the point when it was available.
> I do agree that it would be preferable to have an upstream fix ...
>
More information about the R-devel
mailing list