This function allows for ordination (which helps us to distinguish beta diversity relationships) to be plotted as well as for the corresponding data to be returned.

Generate plots for a list of ordination methods and distances.

ordination_plot(
  obj,
  method = "PCoA",
  distance = "wunifrac",
  color = "TreatmentGroup",
  title = NULL,
  only_data = FALSE
)

ordination_plots(
  obj,
  methods = c("PCoA", "NMDS"),
  distances = c("wunifrac", "unifrac", "bray"),
  color = "TreatmentGroup",
  select_otu_table = "otu_proportions"
)

Arguments

obj

An object to be converted to a metacoder object with create_taxmap.

method

Choose an ordination method from 'PCoA', 'CCA', 'NMDS' or 'DPCoA', Default: 'PCoA'

distance

Choose a distance method or use a pre-computed dist-class object, Default: 'wunifrac'

color

Choose the group or factor of which colors will be mapped to, Default: 'TreatmentGroup'

title

The title of the plot, Default: NULL

only_data

Allows for only ordination data to be generated, Default: FALSE

methods

A list of ordination methods, Default: 'c("PCoA", "NMDS")'

distances

A list of distance methods, Default: 'c("wunifrac", "unifrac", "bray")'

select_otu_table

The data table to use in the observation data. Default: "otu_proportions"

Value

By default, it returns an ordination plot.

Returns a melted dataframe.

Examples

if (FALSE) { # \dontrun{
if (interactive()) {
  # An example ordination plot
  library(MicrobiomeR)
  data <- analyzed_silva
  plot <- ordination_plot(obj = data)
  plot
}
} # }