Skip to contents

Draw a heatmap-style plot from beta diversity distance results.

Usage

plot_beta_diversity(object, annotate_by = NULL, cluster = FALSE)

Arguments

object

A microbiome_diversity object with type = "beta".

annotate_by

Optional named character vector used to annotate samples. Names must be sample identifiers.

cluster

Should samples be reordered by hierarchical clustering?

Value

A ggplot object.

Examples

data("global_patterns", package = "microbiomedataset")

x <- calculate_beta_diversity(global_patterns, method = "bray")
p <- plot_beta_diversity(x)
class(p)
#> [1] "ggplot2::ggplot" "ggplot"          "ggplot2::gg"     "S7_object"      
#> [5] "gg"