Skip to contents

lifecycle-experimental

Computes the same pairwise metrics as community_sharing_pq() and displays them as grouped bars. Useful for precise numerical comparison alongside the network figure.

Usage

community_sharing_barplot_pq(
  physeq,
  fact,
  metrics = default_sharing_metrics(),
  facet_by = c("metric", "pair"),
  show_na_modality = FALSE,
  base_size = 12,
  title = NULL
)

Arguments

physeq

A phyloseq object.

fact

Character. Name of a sample_data(physeq) column. Must have 2 to 4 unique values.

metrics

Named list of metric definitions from make_sharing_metric(). Default: default_sharing_metrics().

facet_by

Character. One of "metric" (default: one panel per metric, x-axis = pair label) or "pair" (one panel per pair, x-axis = metric label). Bar fill colors come from each metric's color field.

show_na_modality

Logical. Same meaning as in community_sharing_pq(). Default FALSE.

base_size

Base font size. Default 12.

title

Plot title. Default NULL.

Value

A ggplot object.

Author

Adrien Taudière

Examples

if (FALSE) { # \dontrun{
# One panel per metric
community_sharing_barplot_pq(data_fungi, fact = "Height")

# One panel per pair
community_sharing_barplot_pq(data_fungi, fact = "Height", facet_by = "pair")
} # }