From maechler at stat.math.ethz.ch  Wed Apr 28 16:45:04 2004
From: maechler at stat.math.ethz.ch (maechler@stat.math.ethz.ch)
Date: Wed Apr 28 16:45:06 2004
Subject: [Rd] Re: model.matrix.default(x ~ y) bug when y is array (PR#6838)
Message-ID: <20040428144504.192BB10449@slim.kubism.ku.dk>

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


[Rd] Re: model.matrix.default(x ~ y) bug when y is array (PR#6838)
maechler@stat.math.ethz.ch