geom_label_pca: Vector's Label for PCA bi-plot

View source: R/pca.R

geom_label_pcaR Documentation

Vector's Label for PCA bi-plot

Description

Vector's Label for PCA bi-plot

Usage

geom_label_pca(
  pca_recipe,
  include_vars = NULL,
  x = PC1,
  y = PC2,
  geom_label_fun = ggplot2::geom_label,
  geom_label_args = list(color = "midnightblue"),
  ...
)

Arguments

pca_recipe

Object class recipe that already step_pca

include_vars

Variable to be included in the arrow, NULL (default) to include all variables.

x

unquoted name to specify which principle component to plot in x-axis (must be one of PC1, PC2, PC3, ... ,etc.)

y

unquoted name to specify which principle component to plot in y-axis (must be one of PC1, PC2, PC3, ... ,etc.)

geom_label_fun

Labelling geom function

geom_label_args

Args to geom_label_fun

...

Args to geom_label_fun

Value

plot label

Examples

library(lbmod)
prep_pca(iris) |>
  pca_scatter_plot(ggplot2::aes(color = Species)) +
  geom_label_pca(prep_pca(iris))

Lightbridge-KS/lbmod documentation built on Jan. 28, 2024, 6:21 p.m.