maechler@stat.math.ethz.ch
2004-Apr-28 16:45 UTC
[Rd] Re: model.matrix.default(x ~ y) bug when y is array (PR#6838)
A spill over from R-help reports by Jonathan Williams, Rich Raubertas, G?ran Brostr?m et al. : x <- 1:7 y. <- x y <- array(x) model.matrix(x ~ y) # behaves badly when called repeatedly; # which for me means memory allocation problems ## as opposed to model.matrix(x ~ y.) # which is all fine The bug is in model.matrix.default(): one part of the problems happens in the line ans <- .Internal(model.matrix(t, data)) (which only returns the intercept part). How to fix this is not yet clear to me, since we have to decide if the internal C code should do more checking or the R code in model.matrix.default. Martin