Skip to content

model.matrix.default chokes on backquote (PR#7202)

2 messages · Gabor Grothendieck, Peter Dalgaard

#
1. That is quite subtle but a fix based on that would appear to 
   solve it.

2. Your example and possibly some verbiage should be added to 
   ?as.character .  

3. In looking for the offending spot, I seem to remember (though I did 
   not keep track of it) that one or more of lm, model.frame.default, 
   terms.formula, etc. had additional applications of as.character 
   directly to a list as in your first example and these should 
   probably be changed to correspond to your second example, as 
   well, where as.character is applied to the elements of the 
   list rather than the lsit itself.
1 day later
#
"Gabor Grothendieck" <ggrothendieck@myway.com> writes:
Hmm, not quite. I tried, and terms like offset(foo) gets me in
trouble. Probably, I was fixing the wrong end of the original problem:
In the comparisons, we can't have one side with backquotes and the
other without them. That doesn't have to mean that they should be
removed from both sides, and indeed it would get us in trouble if
someone was perverse enough to do things like

 y ~ `offset(foo)` + offset(foo)

I.e. perhaps the real issue is that names(data) gets generated without
backquotes.

Anyways, this is a real can of worms and I'm not sure we're not too
close to 2.0.0 to start tampering with it...