Learn R Programming

swfscMisc (version 1.6.5)

ggBiplot: ggBiplot

Description

Plot a biplot of a Principal Components Analysis using ggplot2.

Usage

ggBiplot(pca, x = 1, y = 2, mult.fac = 0.8, arrow.size = 1.5, label.size = 6)

Value

the ggplot2 object is invisibly returned.

Arguments

pca

result from a call to princomp.

x, y

the number or column names of the components to plot.

mult.fac

multiplier factor for lengths of arrows from 0:1.

arrow.size

thickness of arrow lines.

label.size

size of labels.

Author

Eric Archer eric.archer@noaa.gov

Examples

Run this code
pc.cr <- princomp(USArrests, cor = TRUE)
ggBiplot(pc.cr)

Run the code above in your browser using DataLab