powered by
Create a biplot of a Principal Components Analysis using ggplot2.
ggBiplot( pca, pcs = c(1, 2), mult.fac = 0.8, arrow.size = NULL, label.size = 3, plot = TRUE )
the ggplot2 object is invisibly returned.
result from a call to princomp or prcomp.
princomp
prcomp
a two element vector giving the number or column names of the components to plot.
multiplier factor for positions of points relative to extent of plot (0:1).
0:1
thickness of arrow lines. If NULL no arrows are shown.
NULL
size of labels.
show the plot?
Eric Archer [email protected]
pca.princomp <- princomp(USArrests, cor = TRUE) ggBiplot(pca.princomp) pca.prcomp <- prcomp(USArrests, cor = TRUE) ggBiplot(pca.prcomp)
Run the code above in your browser using DataLab