Learn R Programming

tidyMicro (version 1.47)

micro_PERMANOVA: A function to run PERMANOVA on tidi_micro data sets

Description

A wrapper function to call adonis2 from the vegan package. PERMANOVA is a method for partitioning distance matrices among sources of variation and fitting linear models (e.g., factors, polynomial regression) to distance matrices; uses a permutation test with pseudo-F ratios

Usage

micro_PERMANOVA(micro_set, beta_div, method, ..., nperm = 999)

Arguments

micro_set

A tidy_micro data set

beta_div

A dissimilarity matrix calculated by beta_div

method

A character string indicating the method used to calculated dissimilarity

...

Covariates of interest

nperm

Number of permutations

Details

The function adonis2 is based on the principles of McArdle & Anderson (2001) and can perform sequential, marginal and overall tests. Function adonis2 also allows using additive constants or squareroot of dissimilarities to avoid negative eigenvalues

References

vegdist adonis2

See Also

adonis

Examples

Run this code
# NOT RUN {
data(bpd_phy); data(bpd_cla); data(bpd_ord); data(bpd_fam); data(bpd_clin)
otu_tabs = list(Phylum = bpd_phy, Class = bpd_cla,
Order = bpd_ord, Family = bpd_fam)

set <- tidy_micro(otu_tabs = otu_tabs, clinical = bpd_clin) %>%
filter(day == 7) ## Only including the first week

## Bray-Curtis beta diversity
bray <- set %>% beta_div(table = "Family")

set %>% micro_PERMANOVA(bray, method = "bray", bpd1)
# }

Run the code above in your browser using DataLab