Description Usage Arguments See Also Examples
This function plots the variables in the coordinate plane PC1-PC2.
1 | plot_var_pc(mod, col.arrow = "gray60", xlab = NULL, ylab = NULL, ...)
|
mod |
A prcomp or princomp object. |
col.arrow |
color for the arrows. |
xlab, ylab |
labels for x axis and y axis. |
... |
Arguments to be passed to methods, such as graphical parameters (see par). |
[plot_obs_pc()].
1 2 3 4 5 6 7 8 9 | # For a prcomp object
pca1 <- prcomp(USArrests, scale = TRUE) # Example
plot_var_pc(pca1)
plot_var_pc(pca1, main='Variables in PC1 and PC2',
col='blue3', lwd=3)
#
# For a princomp object
pca2 <- princomp(x=USArrests, cor=TRUE)
plot_var_pc(pca2, col='red', lwd=4)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.