Learn R Programming

ggbiplot (version 0.6.1)

ggscreeplot: Screeplot for Principal Components

Description

Produces scree plots (Cattell, 1966) of the variance proportions explained by each dimension against dimension number from various dimension reduction techniques

Usage

ggscreeplot(pcobj, type = c("pev", "cev"), size = 4)

Value

A ggplot2 object

Arguments

pcobj

an object representing a linear dimension technique, such a returned by prcomp or princomp or PCA or lda

type

the type of scree plot. 'pev' corresponds proportion of explained variance, i.e. the eigenvalues divided by the trace. 'cev' corresponds to the cumulative proportion of explained variance, i.e. the partial sum of the first k eigenvalues divided by the trace.

size

point size

References

Cattell, R. B. (1966). The Scree Test For The Number Of Factors. Multivariate Behavioral Research, 1, 245–276.

Examples

Run this code
  data(wine)
  wine.pca <- prcomp(wine, scale. = TRUE)
  ggscreeplot(wine.pca)

Run the code above in your browser using DataLab