viz_pca: Vizualize principal pomponents

Description Usage Arguments Value Examples

View source: R/viz_pca.R

Description

Vizualize principal pomponents

Usage

1
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

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

EmilHvitfeldt/horus documentation built on June 12, 2021, 7 p.m.