[R] screeplot() v.s. plot()

Prof Brian D Ripley ripley at stats.ox.ac.uk
Thu Mar 29 12:56:34 CEST 2001


On Thu, 29 Mar 2001 Ko-Kang at xtra.co.nz wrote:

> Hi,
>
> Suppose I've got a data set that I found the eigenvalues and eigenvectors.  Then I want to draw a screeplot for the eigenvalues.  However it returns:
>    Error in matrix(w.m, nc = NC) : negative extents to matrix
>
> Then I tried a plot() function on the eigenvalues of the data set, and I can successfully draw it!  And the output looks like what the screeplot would show to me.
>
> Is there any difference between them, in the case of plotting the eigenvalues?

screeplot is implement for an object of class "princomp": see its help
page.  For such an object

> plot.princomp
function (x, main = deparse(substitute(x)), ...)
screeplot(x, main = main, ...)

so there is no difference.  I suspect you don't have such an object and so
should not be calling screeplot.

> Thanks,
>
> Kevin
>
> PS.  I've set my mailer to send this message as text-based.  I hope this is the case and none of you will see it as html file.

You forgot to set line wrap, though.

-- 
Brian D. Ripley,                  ripley at 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-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list