Description Usage Arguments Details References See Also Examples
View source: R/micro_PERMANOVA.R
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
1 | micro_PERMANOVA(micro_set, beta_div, method, ..., nperm = 999)
|
micro_set |
A tidy_micro data set |
beta_div |
A dissimilarity matrix calculated by |
method |
A character string indicating the method used to calculated dissimilarity |
... |
Covariates of interest |
nperm |
Number of permutations |
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
vegdist
adonis2
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.