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

pflugshaupt@geobot.umnw.ethz.ch pflugshaupt@geobot.umnw.ethz.ch
Thu, 8 Nov 2001 18:39:45 +0100 (MET)


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