[Rd] strange error with rw2010dev

Martin Maechler maechler at stat.math.ethz.ch
Mon Apr 11 10:07:57 CEST 2005


>>>>> "PD" == Peter Dalgaard <p.dalgaard at biostat.ku.dk>
>>>>>     on 11 Apr 2005 09:46:11 +0200 writes:

 .....

     MM> Thanks again for the report; this should be fixable
     MM> before release.

    PD> Preferably before code freeze! (today)

    PD> I think we (Thomas L.?) got it analysed once before: The
    PD> issue is that summary.matrix is passing
    PD> data.frame(object) back to summary.data.frame without
    PD> removing the AsIs class.

    PD> I don't a simple unclass() will do here.
	       
or, a bit more cautiously,

summary.matrix <- function(object, ...)
    summary.data.frame(data.frame(if(inherits(object,"AsIs")) unclass(object)
    else object), ...)

That does cure the problem in the Kjetil's example and the equivalent

 ## short 1-liner:
 summary(df <- data.frame(mat = I(matrix(1:8, 2))))


I'm currently make-checking the above.
Martin



More information about the R-devel mailing list