Skip to contents

Draw an ordination plot with feature loadings.

Usage

plot_ordination_biplot(
  object,
  method = c("PCA", "PCoA"),
  distance_method = c("bray", "jaccard", "euclidean"),
  x = NULL,
  y = NULL,
  color_by = NULL,
  shape_by = NULL,
  top_n_loading = 10,
  loading_scale = 1
)

Arguments

object

A microbiome_ordination or microbiome_dataset object.

method

Ordination method used when object is a dataset.

distance_method

Distance method used when computing PCoA.

x, y

Axis names. Defaults to the first two axes.

color_by

Optional sample metadata column.

shape_by

Optional sample metadata column.

top_n_loading

Number of feature loadings retained.

loading_scale

Multiplier applied to feature loading vectors.

Value

A ggplot object.

Examples

data("global_patterns", package = "microbiomedataset")
plot_ordination_biplot(global_patterns, method = "PCA", color_by = "SampleType")