var_par_pq: Partition the Variation of a phyloseq object by 2, 3, or 4...

View source: R/beta_div_test.R

var_par_pqR Documentation

Partition the Variation of a phyloseq object by 2, 3, or 4 Explanatory Matrices

Description

lifecycle-experimental

The function partitions the variation in otu_table using distance (Bray per default) with respect to two, three, or four explanatory tables, using adjusted R² in redundancy analysis ordination (RDA) or distance-based redundancy analysis. If response is a single vector, partitioning is by partial regression. Collinear variables in the explanatory tables do NOT have to be removed prior to partitioning. See vegan::varpart() for more information.

Usage

var_par_pq(
  physeq,
  list_component,
  dist_method = "bray",
  dbrda_computation = TRUE
)

Arguments

physeq

(required): a phyloseq-class object obtained using the phyloseq package.

list_component

(required) A named list of 2, 3 or four vectors with names from the ⁠@sam_data⁠ slot.

dist_method

(default "bray") the distance used. See phyloseq::distance() for all available distances or run phyloseq::distanceMethodList(). For "aitchison" and "robust.aitchison" distance, vegan::vegdist() function is directly used.

dbrda_computation

(logical) Do dbrda computations are runned for each individual component (each name of the list component) ?

Details

This function is mainly a wrapper of the work of others. Please make a reference to vegan::varpart() if you use this function.

Value

an object of class "varpart", see vegan::varpart()

Author(s)

Adrien Taudière

See Also

var_par_rarperm_pq(), vegan::varpart(), plot_var_part_pq()

Examples


if (requireNamespace("vegan")) {
  data_fungi_woNA <-
    subset_samples(data_fungi, !is.na(Time) & !is.na(Height))
  res_var <- var_par_pq(data_fungi_woNA,
    list_component = list(
      "Time" = c("Time"),
      "Size" = c("Height", "Diameter")
    ),
    dbrda_computation = TRUE
  )
}


adrientaudiere/MiscMetabar documentation built on July 6, 2024, 7:02 p.m.