
Last chance! 50% off unlimited learning
Sale ends in
screeplot.default
plots the variances against the number of the
principal component. This is also the plot
method for classes
"princomp"
and "prcomp"
.# S3 method for default
screeplot(x, npcs = min(10, length(x$sdev)),
type = c("barplot", "lines"),
main = deparse(substitute(x)), …)
princomp
and prcomp
.require(graphics)
## The variances of the variables in the
## USArrests data vary by orders of magnitude, so scaling is appropriate
(pc.cr <- princomp(USArrests, cor = TRUE)) # inappropriate
screeplot(pc.cr)
fit <- princomp(covmat = Harman74.cor)
screeplot(fit)
screeplot(fit, npcs = 24, type = "lines")
Run the code above in your browser using DataLab