On Mon, 11 Apr 2005, Martin Maechler wrote:

"PD" == Peter Dalgaard <[EMAIL PROTECTED]>
    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), ...)

I do not think that is correct. You need either to remove the "AsIs" class and leave any other classes, or unclass all objects.
Otherwise adding an "AsIs" class will change the behaviour.


I would suggest that if you get to the summary.matrix method you want the summary as a matrix and so should always unclass, but that is debatable (think for example of an object of class c("mts", "ts"), which is a classed matrix, and there is an as.data.frame.ts method but no summary.ts).

--
Brian D. Ripley,                  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to