Vizualize principal pomponents

viz_pca(data, label, components = c(1, 2), loadings = FALSE)

Arguments

data

A data.frame.

label

variable to color with.

components

principal components to showcase.

loadings

Set this to true if you want to see the PCA loadings.

Value

ggplot2 object.

Examples

viz_pca(iris, Species)
viz_pca(iris, Species, c(3, 1))
viz_pca(iris, Species, loadings = TRUE)