ent_rao: Rao's Quadratic Entropy of a Community

View source: R/ent_rao.R

ent_raoR Documentation

Rao's Quadratic Entropy of a Community

Description

Estimate the quadratic entropy \insertCiteRao1982divent of species from abundance or probability data. An estimator \insertCiteLande1996divent is available to deal with incomplete sampling.

Usage

ent_rao(x, ...)

## S3 method for class 'numeric'
ent_rao(
  x,
  distances = NULL,
  tree = NULL,
  normalize = TRUE,
  estimator = c("Lande", "naive"),
  as_numeric = FALSE,
  ...,
  check_arguments = TRUE
)

## S3 method for class 'species_distribution'
ent_rao(
  x,
  distances = NULL,
  tree = NULL,
  normalize = TRUE,
  estimator = c("Lande", "naive"),
  gamma = FALSE,
  as_numeric = FALSE,
  ...,
  check_arguments = TRUE
)

Arguments

x

An object, that may be a named numeric vector (names are species names) containing abundances or probabilities, or an object of class abundances or probabilities.

...

Unused.

distances

a distance matrix or an object of class stats::dist.

tree

an ultrametric, phylogenetic tree. May be an object of class phylo_divent, ape::phylo, ade4::phylog or stats::hclust.

normalize

if TRUE, phylogenetic is normalized: the height of the tree is set to 1.

estimator

An estimator of entropy.

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.

gamma

if TRUE, \gamma diversity, i.e. diversity of the metacommunity, is computed.

Details

Rao's entropy is phylogenetic or similarity-based entropy of order 2. ent_phylo and ent_similarity with argument q = 2 provide more estimators and allow estimating entropy at a chosen level.

All species of the species_distribution must be found in the matrix of distances if it is named. If it is not or if x is numeric, 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 or its numeric equivalent.

Value

A tibble with the site names, the estimators used and the estimated entropy.

References

\insertAllCited

Examples

# Entropy of each community
ent_rao(paracou_6_abd, tree = paracou_6_taxo)
# Similar to (but estimators are not the same)
ent_phylo(paracou_6_abd, tree = paracou_6_taxo, q = 2)

# Functional entropy
ent_rao(paracou_6_abd, distances = paracou_6_fundist)

# gamma entropy
ent_rao(paracou_6_abd, tree = paracou_6_taxo, gamma = TRUE)


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