| asc_paired | R Documentation |
Measures, at each site, the change between a reference state and a
comparison state (e.g. before and after an event) in three layers of the
functional space: position (shift of the abundance-weighted centroid,
\Delta C), dispersion (\DeltaFDis) and volume
(\DeltaFRic). Pass the result to asc_null to test each
layer, and to asc_transitions to see which species moved the
centroid.
asc_paired(
traits,
abund,
sites,
time,
ref_time,
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,
blocks = 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 sample and
one column per species (matched to |
sites |
A vector, one value per row of |
time |
A vector, one value per row of |
ref_time |
The value of |
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 |
blocks |
Optional vector, one value per row of |
An S3 object of class ascent_paired (it also carries the
class ascfcd of ascent 0.5.0, which will be dropped in 0.6.0), a
list whose main elements are rDelta_C (centroid shift per contrast,
as a percentage of the largest distance between species in the functional
space), site_results (per contrast: abs_dist =
||\Delta C||, Delta_FDis, Delta_FRic,
Delta_FRic_rarefied, n_samples and the share of the shift
along each axis), F_space (species coordinates), k_retained
and dim_retention (number of axes and the rule used),
quality of the PCoA and the inputs needed by asc_null().
summary() gives a reading; plot() draws the shift.
Normalization: Delta FDis and Delta FRic are absolute differences, not normalized by the regional pool. Values are not directly comparable across studies with different species pools or trait scales. Only rDelta_C (position) is normalized by Dmax_regional.
FRic = NA: When a community has fewer species than retained PCoA axes,
the convex hull is geometrically undefined and FRic is set to NA,
which propagates to Delta_FRic.
FRic and unequal replicates: with replicates, a species counts as
present in a state if it appears in any of its samples, so FRic grows with
the number of samples. When the two states of a contrast have different
numbers of samples, Delta_FRic_rarefied gives Delta FRic with the
same number of samples in both states: FRic of the state with more samples
is averaged over all subsets of the size of the other state (or over 200
random subsets, with a fixed internal seed, when there are more). Use it to
read the size of the volume change; the tests of asc_null
keep the numbers of samples and remain valid.
Replicates: When several rows share the same site and state (e.g. five
surveys before an event), their relative abundances are averaged (column
means) to describe the state, so the three layers compare the mean
community of each state. The variation among replicates is used by null
model A, which then permutes whole samples between the states (see
asc_null).
# birds_sim: two sites surveyed 5 times before and 5 times after an event.
# At "Logged" the bird community changes; at "Control" nothing changes.
# Check the functional space first (see ?assess_functional_space)
assess_functional_space(birds_sim$traits)
res <- asc_paired(birds_sim$traits, birds_sim$counts,
sites = birds_sim$samples$site,
time = birds_sim$samples$time, ref_time = "Before")
# Layer1_rDeltaC is the centroid shift (% of the functional space): it is
# large at "Logged" and small at "Control". The last section ("Top Functional
# Drivers") lists the species that moved the centroid most (see ?asc_transitions).
summary(res)
# Is each shift larger than sampling noise (A) and organised by traits (B)?
res <- asc_null(res, n_perm = 199, seed = 1)
summary(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.