calc_pairwise_permanovas: Calculate pairwise PERMANOVA results

calc_pairwise_permanovasR Documentation

Calculate pairwise PERMANOVA results

Description

The adonis function in the vegan package does not provide a way to calculate pairwise post-hoc comparisons between factor levels. This function calculates PERMANOVA results using the adonis function for all factor level pairs. Raw p values are returned, but it is recommended to use the provided FDR corrected p values since the multiple comparisons can raise your likelihood of false positive differences.

Usage

calc_pairwise_permanovas(dm, metadata_map, compare_header, n_perm)

Arguments

dm

Dissimilarity matrix of class dist.

metadata_map

The metadata mapping dataframe with samples matching and in the same order as the ones in the provided dm.

compare_header

The header in the metadata mapping dataframe with the factor levels to use for the pairwise comparisons.

n_perm

A vector that controls the number of permutations required.

Value

A dataframe with R2 and P values.

Examples

dm = calc_dm(fruits_veggies$data_loaded)
calc_pairwise_permanovas(dm, fruits_veggies$map_loaded, "Sample_type")

leffj/mctoolsr documentation built on Aug. 5, 2022, 1:27 a.m.