Message-ID: <f8e6ff050805011853g66127107xb0bcae541f19b67@mail.gmail.com>
Date: 2008-05-02T01:53:10Z
From: Hadley Wickham
Subject: all.equal, classes, and order of arguments
> 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/