> I think that this misses the point I was trying to make: lm() et al. treat > logical variables as factors, not as numerical predictors.
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. ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel