| asc_pairwise | R Documentation |
Measures the three layers (position, dispersion and volume) for every pair
of communities, e.g. sites along a gradient or the months of a series. To
test whether the communities differ, pass the result to
asc_null, which runs one global test per layer over all
communities (instead of one p-value per pair).
asc_pairwise(
traits,
abund,
dist_method = "gower",
dim_retention = c("msd", "variance", "broken_stick"),
var_tol = 0.8,
na.rm = TRUE,
correction = c("none", "sqrt"),
type = NULL,
weights = NULL
)
traits |
A data frame or matrix of functional traits, one row per species (row names = species). Categorical traits should be factors. |
abund |
A data frame or matrix of abundances, one row per community
(unique row names, which name the pairs) and one column per species
(matched to |
dist_method |
Distance metric for the trait matrix. Default is "gower". |
dim_retention |
Character. How many PCoA axes to keep: |
var_tol |
Numeric. Proportion of cumulative variance to retain when
|
na.rm |
Logical. Remove missing values? Default is TRUE. |
correction |
Character. |
type, weights |
Optional; passed unchanged to |
An S3 object of class ascent_pairwise (it also carries the
class ascfcd_pw of ascent 0.5.0, which will be dropped in 0.6.0), a
list whose main element is pairwise_results (one row per pair:
Community_A, Community_B, Delta_C_abs,
rDelta_C_pct, Delta_FDis, Delta_FRic), with the
functional space (F_space, k_retained,
dim_retention, quality) and the inputs needed by
asc_null().
Direction of each pair: each pair goes from Community_A to
Community_B, in the order of the rows of abund (the pair of
rows 1 and 2 is named "row1_vs_row2"). Reversing the order reverses the
sign of the shifts and of the leverages.
Normalization: Delta FDis and Delta FRic are absolute differences (see
asc_paired for details).
# Five communities along a gradient from primary forest to farmland
pw <- asc_pairwise(birds_sim$traits, birds_sim$landscape)
# One row per pair of communities; rDelta_C_pct is the centroid shift
# between the two (% of the functional space)
summary(pw)
# The three most different pairs
pr <- pw$pairwise_results
head(pr[order(-pr$rDelta_C_pct), c("Community_A", "Community_B", "rDelta_C_pct")], 3)
# Do the communities differ (A), and is the variation organised by traits (B)?
pw <- asc_null(pw, n_perm = 99, seed = 1)
summary(pw)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.