From p.dalgaard@biostat.ku.dk  Tue Oct  3 17:05:50 2000
From: p.dalgaard@biostat.ku.dk (Peter Dalgaard BSA)
Date: 03 Oct 2000 18:05:50 +0200
Subject: [Rd] all.equal.list() sometimes fails with unnamed and named components (PR#674)
In-Reply-To: Kurt Hornik's message of "Tue, 3 Oct 2000 17:40:47 +0200 (CEST)"
References: <200009292118.XAA02892@pubhealth.ku.dk> <14809.65023.834763.292861@mithrandir.hornik.net>
Message-ID: <x21yxxvrj5.fsf@blueberry.kubism.ku.dk>

Kurt Hornik <Kurt.Hornik@ci.tuwien.ac.at> writes:

> Maybe we should change this as follows: if either of the two lists has
> names, work though the named components.  Warn about the ones not
> present in both.  Compare the ones present in both.  Then get rid of all
> named components and compare what is left in positional order.
> 
> As I said, I am not sure that this is really what we want.
> 
> Comments?

I think you might be right, and also that this is an easy thing to
implement. Then we'd have

all.equal(list(a=1,b=2,3,4),list(3,b=2,4,a=1)) == TRUE

Right?

However, BigBrother has

> all.equal(list(a=1,b=2,3,4),list(3,b=2,4,a=1)) 
[1] "Names: 2 string mismatches"
attr(, "continue"):
[1] T

> all.equal(list(a=1,b=2,3,4), list(a=1,b=2,4,3))
[1] T

..which does look like a "compatible bug"

Hmm. Maybe one wants positional matching in any case? But then, what
is the named-component extraction about??

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] all.equal.list() sometimes fails with unnamed and named components (PR#674)
Peter Dalgaard BSA