From Arkady.Sherman at ksu.ru  Sat Nov 29 20:05:15 2008
From: Arkady.Sherman at ksu.ru (Arkady.Sherman at ksu.ru)
Date: Sat, 29 Nov 2008 20:05:15 +0100 (CET)
Subject: [Rd] A small bug in R code of the legend function of the
	Graphics (PR#13350)
Message-ID: <20081129190515.AD784282EFF0@mail.pubhealth.ku.dk>

Martin Maechler wrote:
> but do.lines is never specified.  It can be FALSE (if there are no
> lines drawn) and a user can indeed set 'merge = TRUE" in such a
> situation.
> However, can you think of a situation where this was desirable?
> I think it should not have any effect in such a case
> {... but unfortunately it currently has ... yet another
>      sign that legend() is ``hopelessly over-featured'' ;-) }
> and possibly rather give a warning in such a case...
> 
> 
>     ASh> Guess that seg.len should be initialized before the condition "if (do.lines)"
> 
> not really; it means  'segment length' should not be used unless
> segments ("lines") are drawn.
> 
> Thank you for your note;  you are right that legend() is not
> entirely correct in such a border-line situation.
> 
> Regards,
> Martin Maechler, ETH Zurich

Thanks for the response.
Yes it's unusual to set merge without lines. I modified existing code and didn't pay attention
to the merge parameter and got the error "object "seg.len" not found". There was no connection
between the merge parameter and the error produced. So I modified the code and didn't unset
merge :). So it's better to gave an warning, or to set automatically merge to false if isn't needed.
	Arkady



[Rd] A small bug in R code of the legend function of the Graphics (PR#13350)
Arkady.Sherman at ksu.ru