[Rd] all.equal, classes, and order of arguments

hadley wickham h.wickham at gmail.com
Fri May 2 03:53:10 CEST 2008


> 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/



More information about the R-devel mailing list