micro_PERMANOVA: A function to run PERMANOVA on tidi_micro data sets

Description Usage Arguments Details References See Also Examples

View source: R/micro_PERMANOVA.R

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

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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)

tidyMicro documentation built on Jan. 13, 2021, 6:18 a.m.