Skip to contents

Draw an interactive 3D ordination plot using plotly.

Usage

plot_ordination_3d(
  object,
  method = c("PCoA", "PCA"),
  distance_method = c("bray", "jaccard", "euclidean"),
  color_by = NULL,
  text_by = "sample_id"
)

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.

color_by

Optional sample metadata column.

text_by

Optional sample metadata column shown on hover.

Value

A plotly htmlwidget.

Examples

data("global_patterns", package = "microbiomedataset")
ord <- run_ordination(global_patterns, method = "PCoA", n_axes = 3)
plot_ordination_3d(ord, color_by = "SampleType")