[Rd] mva:princomp.default not set correctly (PR#3168)

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Mon Jun 2 17:16:29 MEST 2003


Prof Brian Ripley <ripley at stats.ox.ac.uk> writes:

> This is not about princomp.default at all!  That snippet of code does not
> appear there.
> 
> Please do check against the S-PLUS original of biplot.default: this is in
> biplot.default.  I very much doubt if you understand the intentions
> (not that I do either).

Sorry, Brian, but: Pot, kettle....

> > The offending bit of code from mva:princomp.default seems to be
> > 
> >     if (missing(xlim) && missing(ylim)) 
> >         xlim <- ylim <- rangx1 <- rangx2 <- range(rangx1, rangx2)
> >     else if (missing(xlim)) 
> >         xlim <- rangx1
> >     else ylim <- rangx2

As far as I can see, this is not equivalent to S-PLUS's logic. For
that, the 3rd line should read

        if (!missing(ylim))

So in S-PLUS, xlim gets ignored if ylim is specified, whereas in R it
is vice versa. I suspect that neither case is desirable? 

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907



More information about the R-devel mailing list