[Rd] all.equal.list() sometimes fails with unnamed and named components (PR#674)
cberry@tajo.ucsd.edu
cberry@tajo.ucsd.edu
Fri, 29 Sep 2000 23:18:10 +0200 (MET DST)
examples:
1) Fails to report that components 2 and 3 differ
all.equal(list(1,2,3,zap=1),list(1,3,4,zap=2))
[1] "Component zap: Mean relative difference: 1
2) Incorrectly asserts all are equal when components 2 and 3 differ
> all.equal(list(1,2,3,zap=1),list(1,3,4,zap=1))
[1] TRUE
3) Removing named component reveals differences:
> all.equal(list(1,2,3,1),list(1,3,4,1))
[1] "Component 2: Mean relative difference: 0.5"
[2] "Component 3: Mean relative difference: 0.3333333"
4) Unequal first component reveals differences
> all.equal(list(2,2,3,zap=1),list(1,3,4,zap=1))
[1] "Component : Mean relative difference: 0.5"
[2] "Component : Mean relative difference: 0.5"
[3] "Component : Mean relative difference: 0.5"
> all.equal(list(2,2,3,zap=1),list(1,3,4,zap=2))
[1] "Component : Mean relative difference: 0.5"
[2] "Component : Mean relative difference: 0.5"
[3] "Component : Mean relative difference: 0.5"
[4] "Component zap: Mean relative difference: 1"
>
5) Second component IS equal, but:
> all.equal(list(2,2,3,zap=1),list(1,2,4,zap=2))
[1] "Component : Mean relative difference: 0.5"
[2] "Component : Mean relative difference: 0.5"
[3] "Component : Mean relative difference: 0.5"
[4] "Component zap: Mean relative difference: 1"
--please do not edit the information below--
Version:
platform = sparc-sun-solaris2.7
arch = sparc
os = solaris2.7
system = sparc, solaris2.7
status =
major = 1
minor = 1.0
year = 2000
month = June
day = 15
language = R
Search Path:
.GlobalEnv, Autoloads, package:base
Chuck Berry
--
Charles C. Berry (858) 534-2098
Dept of Family/Preventive Medicine
E mailto:cberry@tajo.ucsd.edu UC San Diego
http://hacuna.ucsd.edu/members/ccb.html La Jolla, San Diego 92093-0645
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._