Re: [R-pkg-devel] Problem in stats::model.matrix when omitting two-way interactions

2017-03-30 Thread Fox, John
Dear Paul, Isn't this really a question for r-help rather than r-package-devel? In any event, I think that your message is based on (an entirely understandable) misunderstanding of what the : operator on the right-hand side of a model formula does. The : operator is equivalent to %in%, and used

[R-pkg-devel] Problem in stats::model.matrix when omitting two-way interactions

2017-03-30 Thread Paul Buerkner
Hi all, recently I stumbled upen a problem in stats::model.matrix that I think is worth reporting. When I run: > dat <- data.frame( > y = rnorm(8), > x1 = factor(rep(0:1, each = 4)), > x2 = factor(rep(rep(0:1, each = 2), 2)), > x3 = factor(rep(0:1, 4)) > ) > > stats::model.matrix(y ~ x1+