[Rd] eqscplot() in library MASS: fails when given only one point (PR#1164)

ripley@stats.ox.ac.uk ripley@stats.ox.ac.uk
Fri, 9 Nov 2001 08:44:07 +0100 (MET)


This is not a bug.  There is no way one can scale the plot axes equally
when no indication has been given of the scaling expected for either!

It has always seemd to be that plot(x=1, y=1) shoul dnot work: it
has not supplied enough information!

On Thu, 8 Nov 2001 pflugshaupt@geobot.umnw.ethz.ch wrote:

> I found the following in eqscplot, library MASS:
>
>
> When given just one point, it fails:
>
> > eqscplot(x=1, y=1)
> Error in plot.window(xlim, ylim, log, asp, ...) :
>     need finite xlim values
>
> After inserting browser() just before the last line in eqscplot() (in which
> plot() gets called), I found the following:
>
> > eqscplot(x=1, y=1)
> Called from: eqscplot(x = 1, y = 1)
> Browse[1]> xlim
> [1] NaN NaN
> Browse[1]> ylim
> [1] NaN NaN
>
>
> This results from the lines 35 and 36:
>
>     xuin <- oxuin <- oldpin[1]/diff(xlim)
>     yuin <- oyuin <- oldpin[2]/diff(ylim)
>
> which will give Inf values, since diff(xlim) and diff(ylim) will be zero at
> that point (xlim and ylim containing c(1, 1) in this case).
>
> I can't propose a patch, though, since I haven't the time to really work out
> how the calculation is done (sorry).
>
> > version
>          _
> platform ppc-apple-macos
> arch     ppc
> os       MacOS
> system   ppc, MacOS
> status
> major    1
> minor    3.1
> year     2001
> month    08
> day      31
> language R
>
> I use the MASS version which comes with the current full Mac R package
> (rm131_FULL.sit). If this is already fixed in a newer version of the
> library, I apologize for the waste of bandwidth.
>
>
> Cheers
>
> Kaspar Pflugshaupt
>
>
>
> --
>
> Kaspar Pflugshaupt
> Geobotanisches Institut
> Zuerichbergstr. 38
> CH-8044 Zuerich
>
> Tel. ++41 1 632 43 19
> Fax  ++41 1 632 12 15
>
> mailto:pflugshaupt@geobot.umnw.ethz.ch
> privat:pflugshaupt@mails.ch
> http://www.geobot.umnw.ethz.ch
>
>
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> 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
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


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