tidy_pca_biplot: Create PCA Biplot

View source: R/unsupervised-pca.R

tidy_pca_biplotR Documentation

Create PCA Biplot

Description

Visualize both observations and variables in PC space

Usage

tidy_pca_biplot(
  pca_obj,
  pc_x = 1,
  pc_y = 2,
  color_by = NULL,
  arrow_scale = 1,
  label_obs = FALSE,
  label_vars = TRUE
)

Arguments

pca_obj

A tidy_pca object

pc_x

Principal component for x-axis (default: 1)

pc_y

Principal component for y-axis (default: 2)

color_by

Optional column name to color points by

arrow_scale

Scaling factor for variable arrows (default: 1)

label_obs

Logical; label observations? (default: FALSE)

label_vars

Logical; label variables? (default: TRUE)

Value

A ggplot object


tidylearn documentation built on Feb. 6, 2026, 5:07 p.m.