Learn R Programming

cwhmisc (version 2.1)

p.screeplot.princomp: Plot screeplot

Description

p.screeplot.princomp plots a screeplot with labels of cumulative variances

Arguments

object
an object of class "princomp" created by princomp
variables
a vector of integers selecting the elements of $object$sdev^2$.
cumulative
a logical value. If FALSE, the labels on bars show variances. If TRUE, they show cumulative variances.
main
overall title for the plot.
ylim
limits for the y axis.
...
optional arguments for barplot

Value

  • A numeric vector (or matrix, when beside = TRUE), say mp, giving the coordinates of all the bar midpoints drawn, useful for adding to the graph.

synopsis

p.screeplot.princomp(object, variables=seq(length(object$sdev)), cumulative=TRUE, main=deparse(substitute(object)), ylim=c(0,max(vars)+0.05),...)

Examples

Run this code
library(stats)
  m <- cbind(rnorm(100),rlnorm(100))
  p.screeplot.princomp(princomp(m))
p.screeplot.princomp(princomp(m),main="Screeplot",ylab="Variances",cex=0.6)

Run the code above in your browser using DataLab