plot_pca: Plot 2 components of Principal Component Analysis

View source: R/2_ggproto_visualize.r

plot_pcaR Documentation

Plot 2 components of Principal Component Analysis

Description

Performs PCA on the data and used proto_default to plot with percent variation labels.

Usage

plot_pca(data, components = c(1, 2), ...)

Arguments

data

Numeric matrix or data.frame of the observations.

components

The 2 numbers of the principal components to use.

...

Optionally pass arguments to proto_default

See Also

proto_default()

Examples

dat <- scale_sd(wine[, 2:6])
plot_pca(data = dat)

## Different components, class coloring
clas <- as.factor(wine$Type)
plot_pca(data = dat, components = c(1, 3), position = "center",
         aes_args = list(color = clas, shape = clas))

nspyrison/spinifex documentation built on Jan. 10, 2025, 6:15 p.m.