Skip to content

inconsistent handling of factor, character, and logical predictors in lm()

1 message · Abby Spurdle

#
I'm unenthusiastic about mapping TRUE to -1 and FALSE to 1, in the model matrix.
(I nearly got that back the front).

However, I've decided to agree with your original suggestion,
regarding $xlevels.
I think it should include the logical levels, if that's the right term...

However, I note that the output still won't be completely consistent.
Because one case leads to a logical vector and the other cases lead to
character vectors.