pca_loadings_plot | R Documentation |
A lollipop plot of PCA variable loadings, as provided by prcomp, e.g., PC1, PC2, ...
pca_loadings_plot(
obj,
components = 1:3,
sortby = 1,
threshold = 0,
reverse = NULL
)
obj |
Output of prcomp |
components |
A numeric vector of components to plot |
sortby |
Sort variables by loadings on this component (index to component vector) |
threshold |
Remove variables with sum(abs(loadings)) below threshold (default=0) |
reverse |
Vector of components that will be multiplied by -1 |
ggplot object
m <- prcomp(mtcars, scale = T)
pca_loadings_plot(m, components = c(1,2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.