> a <- list()
> b <- structure(list(), class=c("list", "a"))
> all.equal(a, b)
[1] "Attributes: < target is NULL, current is list >"
> all.equal(b, a)
[1] "Attributes: < Modes: list, NULL >" [2] "Attributes: < names for target but not for current >" [3] "Attributes: < Length mismatch: comparison on first 0 components >"
which does not reveal the simple difference between a and b. I had also expected that all.equal would (in some sense) be symmetric with respect to its arguments, but I can see that this would be very hard to guarantee in general.
Hadley
-- http://had.co.nz/ ______________________________________________ R-devel_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-develReceived on Fri 02 May 2008 - 01:56:56 GMT
Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Australia.
Archive generated by hypermail 2.2.0, at Thu 08 May 2008 - 13:31:27 GMT.
Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.