asc_baseline: Functional Metrics of Each Community

View source: R/asc_baseline.R

asc_baselineR Documentation

Functional Metrics of Each Community

Description

Calculates, for each community separately and without contrasts, the abundance-weighted centroid on each axis of the functional space (CWM), functional dispersion (FDis) and convex hull volume (FRic). Useful to describe the communities before comparing them.

Usage

asc_baseline(
  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
)

Arguments

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 and one column per species (matched to traits by name).

dist_method

Distance metric for the trait matrix. Default is "gower".

dim_retention

Character. How many PCoA axes to keep: "msd" (default since 0.5.1: the number of axes, 2 to 10, whose Euclidean distances best reproduce the trait distances, i.e. the minimum mean squared deviation of Maire et al. 2015), "variance" (axes needed to reach var_tol of the positive variance; the default up to 0.5.0, use it to reproduce earlier results) or "broken_stick" (axes explaining more than the broken-stick expectation). assess_functional_space shows the fidelity for each number of axes.

var_tol

Numeric. Proportion of cumulative variance to retain when dim_retention = "variance". Default is 0.80.

na.rm

Logical. Remove missing values? Default is TRUE.

correction

Character. "none" (default) builds the PCoA on the Gower dissimilarity, as in 0.1.1. "sqrt" uses its square root, which Gower (1971) showed to be Euclidean for complete data with constant weights (no negative eigenvalues). It changes the distances between species (and the shape of the space), so results with and without it are not comparable; its effect on the tests has not been evaluated by simulation. An option when the space quality is low, not a default recommendation.

type, weights

Optional; passed unchanged to daisy (e.g. to declare asymmetric binary traits or to down-weight traits coded in several columns). Default: not used.

Value

An S3 object of class ascent_baseline (it also carries the class ascfcd_base of ascent 0.5.0, which will be dropped in 0.6.0), a list whose main element is entities_results (one row per community: Entity, the CWM on each axis, FDis and FRic). Here "Entity" means community (row of abund), not a functional entity of asc_entities.

Examples

# Absolute metrics of each community (no contrasts): community-weighted
# position on each axis (CWM), dispersion (FDis) and volume (FRic)
base <- asc_baseline(birds_sim$traits, birds_sim$landscape)
summary(base)

# Compare FDis and FRic along the gradient from primary forest to farmland
base$entities_results[, c("Entity", "FDis", "FRic")]


ascent documentation built on Nov. 30, 2026, 1:07 a.m.