plot_obspc | R Documentation |
This function plots the observations in the coordinate plane PC1-PC2.
plot_obspc(mod, lchar = 3, pch = 20, ...)
mod |
a prcomp or princomp object obtained from |
lchar |
the number of first characters to identify points. |
pch |
an integer specifying a symbol or a single character to be used as the default in plotting points. |
... |
arguments to be passed to methods, such as graphical parameters (see par). |
The function returns a list with two elements, coordinate points for first and second dimensions.
# For a prcomp object
pca1 <- prcomp(USArrests, scale=TRUE) # Example
plot_obspc(pca1) # Default plot
plot_obspc(pca1, lchar=3, col='blue', pch=8) # Customized plot
# For a princomp object
pca2 <- princomp(x=USArrests, cor=TRUE)
plot_obspc(pca2, col='red', ylim=c(-4, 4), xlim=c(-4, 4))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.