Learn R Programming

tidylearn (version 0.1.0)

tidy_pca_biplot: 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
)

Value

A ggplot object

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)