[Rd] w0 in legend

Ben Bolker bolker@zoo.ufl.edu
Fri, 9 Jun 2000 16:26:10 -0400 (EDT)


On 9 Jun 2000, Peter Dalgaard BSA wrote:

> Paul Gilbert <pgilbert@bank-banque-canada.ca> writes:
> 
> > In Version 1.1.0 Under development (unstable) (June 8, 2000)
> > there seems to be a problem with an internal variable w0 in legend that
> > generates the following new error:
> > 
> > Error in legend((par()$usr)[1:2], (par()$usr)[3:4], Legend, lty = lty,  :
> >  Object "w0" not found
> > >
> 
> Looks like it isn't getting set in the nx==2 case. But what is the
> correct value here, 0?

  No, w/ncol; w0 is the width of a single column within the legend.  If
n==1 it reduces to w.
  Again, sorry about the bug.

> 
>     if (nx == 2) {
>         x <- sort(x)
>         y <- sort(y)
>         left <- x[1]
>         top <- y[2]
>         w <- diff(x)

          w0 <- w/ncol

>         h <- diff(y)
>         x <- mean(x)
 [snip]

--
Ben Bolker                                  bolker@zoo.ufl.edu
Zoology Department, University of Florida   http://www.zoo.ufl.edu/bolker
318 Carr Hall/Box 118525                    tel: (352) 392-5697
Gainesville, FL 32611-8525                  fax: (352) 392-3704

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._