I wondered that, but I think we need to hear from the author of identical().
It is neater to have attributes printed in a consistent order, though. On Tue, 20 Apr 2004, Tony Plate wrote: > What about changing identical() to ignore the order of attributes? Is > there any code anywhere that depends on the order of attributes, other than > identical()? I've only seen attributes treated as an unordered set, and > never as an ordered list. There are some functions in S-plus that change > the order of attributes, and the only thing this affects is > identical(). (Which in S-plus also pays attention to the order of attributes.) > > -- Tony Plate > > At Tuesday 05:42 AM 4/20/2004, [EMAIL PROTECTED] wrote: > >"Swinton, Jonathan" <[EMAIL PROTECTED]> writes: > > > > > # works as expected > > > > ac <- c('A','B'); > > > > identical(ac,ac[1:2]) > > > [1] TRUE > > > > > > #but > > > > af <- factor(ac) > > > > identical(af,af[1:2]) > > > [1] FALSE > > > > > > Any opinions? > > > >Did a cross-check with Splus and it doesn't do that , so I think it > >qualifies as a bug. Shouldn't be too hard to fix (might lose a little > >efficiencty though). > > > >-- > > O__ ---- Peter Dalgaard Blegdamsvej 3 > > c/ /'_ --- Dept. of Biostatistics 2200 Cph. N > > (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 > >~~~~~~~~~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 > > > >______________________________________________ > >[EMAIL PROTECTED] mailing list > >https://www.stat.math.ethz.ch/mailman/listinfo/r-devel > > ______________________________________________ > [EMAIL PROTECTED] mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-devel > > -- 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 ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-devel