fun_ordinariness: Functional ordinariness of a community

View source: R/fun_ordinariness.R

fun_ordinarinessR Documentation

Functional ordinariness of a community

Description

The ordinariness of a species is the average similarity of its individuals with others \insertCiteLeinster2012divent.

Usage

fun_ordinariness(
  species_distribution,
  similarities = diag(sum(!colnames(species_distribution) %in% non_species_columns)),
  as_numeric = FALSE,
  check_arguments = TRUE
)

Arguments

species_distribution

an object of class species_distribution.

similarities

a similarity matrix, that can be obtained by fun_similarity. Its default value is the identity matrix.

as_numeric

if TRUE, a number or a numeric vector is returned rather than a tibble.

check_arguments

if TRUE, the function arguments are verified. Should be set to FALSE to save time when the arguments have been checked elsewhere.

Details

All species of the species_distribution must be found in the matrix of similarities if it is named. If it is not, its size must equal the number of species. Then, the order of species is assumed to be the same as that of the species_distribution.

Value

A tibble with the ordinariness of each species, or a matrix if argument as_numeric is TRUE.

References

\insertAllCited

Examples

fun_ordinariness(paracou_6_abd, fun_similarity(paracou_6_fundist))

# Compare with probabilities
probabilities(paracou_6_abd)
# Decrease similarities so that ordinariness is close to probability
fun_ordinariness(paracou_6_abd, fun_similarity(paracou_6_fundist, rate = 100))


divent documentation built on April 3, 2025, 7:40 p.m.