add_ternary_pc: Add principal component paths to a ternary plot

View source: R/ternary_diagram.R

add_ternary_pcR Documentation

Add principal component paths to a ternary plot

Description

Add principal component paths to a ternary plot

Usage

add_ternary_pc(
  p,
  X,
  group = NULL,
  pcs = 1:2,
  basis = coda.base::ilr_basis(3),
  n = 600,
  eps = 0.001,
  ...
)

Arguments

p

A ggplot2 object created by ternary_plot().

X

A numeric matrix or data frame with exactly three columns.

group

Optional grouping variable of length nrow(X). If supplied, PCs are computed separately by group.

pcs

Integer vector indicating which principal components to draw.

basis

An ilr basis. Default is coda.base::ilr_basis(3).

n

Number of sampled points per PC path.

eps

Small positive threshold used to keep the path inside the simplex.

...

Further arguments passed to ggplot2::geom_path().

Value

A ggplot2 object.


coda.plot documentation built on April 12, 2026, 9:06 a.m.