Skip to content

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

2 messages · Gabor Grothendieck, Peter Dalgaard

#
In model.frame.default there is a line:

   varnames <- as.character(vars[-1])

that turns part of a call object, vars, into a character string.  
We could change that to:

   varnames <- strip.backquote(as.character(as.list(vars[-1])))

or perhaps as.character should not return the backquotes in the
first place in which case the fix would be to fix as.character.
#
"Gabor Grothendieck" <ggrothendieck@myway.com> writes:
Or not use it in this way. I forget what the reasoning was behind the
current behaviour of as.character, but the point is that
[1] "list"   "`a(b)`" "`c(d)`"

whereas for instance
[1] "a(b)" "c(d)"