plot_var_pc: Plot variables in the coordinate plane PC1-PC2.

Description Usage Arguments See Also Examples

Description

This function plots the variables in the coordinate plane PC1-PC2.

Usage

1
plot_var_pc(mod, col.arrow = "gray60", xlab = NULL, ylab = NULL, ...)

Arguments

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).

See Also

[plot_obs_pc()].

Examples

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)

fhernanb/usefultools documentation built on May 10, 2019, 8:06 a.m.