pca_biplot: PCA Bi-plot

View source: R/pca.R

pca_biplotR Documentation

PCA Bi-plot

Description

Plot PCA bi-plot from recipe object that has step_pca

Usage

pca_biplot(
  pca_recipe,
  mapping = NULL,
  x = PC1,
  y = PC2,
  include_vars = NULL,
  alpha = 0.8,
  size = 2,
  geom_type_scatter = geom_point,
  x_origin = 0,
  y_origin = 0,
  arrow_scale = 1,
  color_arrow = "black",
  geom_label_fun = ggplot2::geom_label,
  geom_label_args = list(color = "midnightblue"),
  ...
)

Arguments

pca_recipe

Object class recipe that already step_pca

mapping

ggplot2 aesthetic mapping (passed to geom_point)

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.)

alpha

point transparency (passed to geom_point)

size

size of point (passed to geom_point)

geom_type_scatter

(unquoted name) Type of scatter plot: geom_point or geom_text

x_origin

(numeric) x-origin of the arrow (passed to lbmod::geom_arrow_pca)

y_origin

(numeric) y-origin of the arrow (passed to lbmod::geom_arrow_pca)

arrow_scale

(numeric) scale factor of the arrow (passed to lbmod::geom_arrow_pca)

color_arrow

(character) color of the arrow (passed to lbmod::geom_arrow_pca)

...

passed to geom_point

geom_type

unquoted name of geom to use, must be one of geom_label, geom_label_repel, geom_text, or geom_text_repel

hjust

(numeric) passed to geom_text or geom_label

vjust

(numeric) passed to geom_text or geom_label

size_txt

(numeric) size of geom_text or geom_label

color

(character) color of geom_text or geom_label

check_overlap

passed to geom_text

label.padding

passed to geom_label

label.r

passed to geom_label

label.size

passed to geom_label

segment.color

color of the segment, NA for no line segment (passed to geom_label_repel or geom_text_repel)

min.segment.length

minimum length that will draw line segment (passed to geom_label_repel or geom_text_repel)

force

pushing force for overlapping label (passed to geom_label_repel or geom_text_repel)

force_pull

pulling force to data points (passed to geom_label_repel or geom_text_repel)

max.overlaps

maximum label overlapping (passed to geom_label_repel or geom_text_repel)

size_ggrepel

size of the label (passed to geom_label_repel or geom_text_repel)

Value

plot


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