swfscMisc (version 1.3)

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)

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.

Value

the ggplot2 object is invisibly returned.

Examples

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

# }

Run the code above in your browser using DataCamp Workspace