permanova_pairwise: PERMANOVA multiple comparisons

Description Usage Arguments Value Author(s) See Also Examples

Description

Wrapper function for pairwise multiple comparisons using 'adonis2' from package 'vegan', and adjusted p-values using 'p.adjust()'.

Usage

1
2
3
4
5
6
7
8
permanova_pairwise(
  x,
  grp,
  permutations = 999,
  method = "bray",
  padj = "bonferroni",
  ...
)

Arguments

x

Community 'data.frame' or 'dist' object.

grp

Vector of groups: factor levels to be compared.

permutations

Number of permutations, or else the permutation structure from 'permute::how()'.

method

Dissimilarity method from 'vegdist' if 'x' is not a distance matrix, default is 'bray'.

padj

The p-value correction method, one of the methods supported by 'p.adjust()'; default is 'bonferroni'.

...

Other arguments passed to 'adonis2'.

Value

Table with pairwise factors, SS, pseudo-F, R^2^, p-value and adjusted p-value.

Author(s)

Rob Smith, inspired by Pedro Martinez Arbizu and Sylvain Monteux.

See Also

https://github.com/pmartinezarbizu/pairwiseAdonis

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# typical usage:
data(oakwoods, package='ecole')
spe <- oakwoods$spe
env <- oakwoods$env
D   <- vegan::vegdist(spe, 'bray')
table(env$thiltype)
permanova_pairwise(x = D, grp = env$thiltype)
# warning when any factor level contains singletons:
table(env$aspclass)
permanova_pairwise(x = D, grp = env$aspclass)

phytomosaic/ecole documentation built on Jan. 2, 2022, 11:24 p.m.