Learn R Programming

coda.plot (version 0.1.10)

clr_biplot: Compositional CLR Biplot

Description

Generates a centered log-ratio (CLR) biplot for compositional data.

Usage

clr_biplot(
  X,
  group = NULL,
  biplot_type = "covariance",
  alpha = NULL,
  shape_group = NULL,
  return_data = FALSE
)

Value

A ggplot object displaying the biplot. If return_data is TRUE, a list containing dataframes with observations and variables and the ggplot object is returned.

Arguments

X

A matrix or data frame containing compositional data.

group

factor used to color the observations.

biplot_type

Character string specifying the type of biplot. Either `"covariance"` (default) or `"form"`.

alpha

Optional numeric value between 0 and 1. If provided, this overrides biplot_type. Controls the type of biplot:

  • 0 = covariance biplot

  • 1 = form biplot

shape_group

Optional factor used to assign shapes to the observations.

return_data

Should the data (observations and variables) be returned