[R] Error in x[good, ] * w : non-conformable arrays

Mark Clements Mark.Clements at anu.edu.au
Tue May 9 04:27:39 CEST 2006


>From posts in Sep 2004 and Feb 2005, glm() was raising "Error in x[good, ] * w : non-conformable arrays". I can reproduce this error using:

df1 = data.frame(u=1:10,
                 v=rpois(10,10),
                 z=array(1,10,dimnames=list(1:10)))
glm(v~u+offset(log(z)), data=df1, family=poisson)

-- which seems to be due to the variable z have dimnames. In glm.fit(), the error is traced to some weight vector w having class "numeric" on the first iteration and class "array" on the second iteration. Would this problem be solved by changing "x[good, ] * w" in glm.fit() to "x[good, ] * as.numeric(w)"?

With kind regards, Mark Clements.

https://stat.ethz.ch/pipermail/r-help/2005-February/066784.html
https://stat.ethz.ch/pipermail/r-help/2004-September/057888.html




More information about the R-help mailing list