Partition the Variation of a phyloseq object by 2, 3, or 4 Explanatory Matrices
Source:R/beta_div_test.R
var_par_pq.Rd
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.
Arguments
- physeq
(required): a
phyloseq-class
object obtained using thephyloseq
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 runphyloseq::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) ?
Value
an object of class "varpart", see vegan::varpart()
Details
This function is mainly a wrapper of the work of others.
Please make a reference to vegan::varpart()
if you
use this function.
Examples
# \donttest{
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
)
}
# }