Betadispersion: Multivariate homogeneity of groups dispersions for several...

View source: R/betadispersion.R

BetadispersionR Documentation

Multivariate homogeneity of groups dispersions for several distance methods.

Description

This function is based on functions distance, betadisper and permutest from phyloseq and vegan packages. It calculates matrix distances on a phyloseq-class object (making use of distance) and then performs an analysis of multivariate homogeneite of group dispersions (variances) based on the formula. Then, it applies permutest on these results. It allows the user to wrap all these functions and loop over several distance methods (Bray-Curtis, UniFrac, Weighted UniFrac...).

Usage

Betadispersion(
  data,
  formula,
  distances,
  permutest.options,
  betadisper.options,
  type = "Samples",
  ...
)

Arguments

data

a phyloseq-class. For more details, check distance funtion.

formula

Model formula to be passed to group argument from betadisper.

distances

Character string including multiple distance methods to be used. Further details to be found in distance.

permutest.options

Further arguments to be passed to permutest. They should be included as a list (see examples)

betadisper.options

Further arguments to be passed to betadisper. They should be included as a list (see examples)

type

character string with the type of comparison to used (sample-wise or taxa-wise, with default c(anova.cca"Samples")). Check distance for further details.

...

Further arguments to be passed to distance function from package phyloseq.

Value

Returns a list with to elements:

  1. A data frame containing the tab component of permutest returns value, for every distance used. This includes information of sources of variation, degrees of freedom, sequential sums of squares, mean squares, F statistics, partial R-squared and p-values, based on N permutations

  2. A list with as many elements as distances were set. Each element includes all information provided by an typical anova.cca result object.

Examples



betadisper_location<- Betadispersion(normalized_phyloseq,distances = c("bray",
"unifrac", "wunifrac"), formula = "location", betadisper.options= list( bias.adjust = TRUE))




nuriamw/micro4all documentation built on May 2, 2024, 9:18 a.m.