Learn R Programming

entropart (version 1.1.3)

Diversity: Generalized diversity of a community

Description

Calculates the generalized diversity of order $q$ of a probability vector.

Usage

Diversity(Ps, q, CheckArguments = TRUE)
bcDiversity(Ns, q, Correction = "Best", CheckArguments = TRUE)

Arguments

Ps
A probability vector, summing to 1.
Ns
A numeric vector containing species abundances.
q
A number.
Correction
A string containing one of the possible corrections: "None" (no correction), "ChaoShen", "Grassberger", "Holste", "Bonachela" or "Best", the default value.
CheckArguments
Logical; if TRUE, the function arguments are verified. Should be set to FALSE to save time when the arguments have been checked elsewhere.

Value

  • A number equal to the calculated diversity.

Details

Diversity calls Tsallis to calculate entropy and transforms it into diversity by calculating its deformed exponential. Bias correction requires the number of individuals to estimate sample Coverage. Use bcDiversity and choose the Correction.

References

Marcon, E., Scotti, I., Herault, B., Rossi, V. and Lang, G. (2014). Generalization of the partitioning of Shannon diversity. PLOS One 9(3): e90289.

See Also

Tsallis, expq

Examples

Run this code
# Load Paracou data (number of trees per species in two 1-ha plot of a tropical forest)
  data(Paracou618)
  # Ns is the total number of trees per species
  Ns <- Paracou618.MC$Ns
  # Whittaker plot
  plot(sort(Ns[Ns != 0], decr = TRUE), log = "y", type = "b",
    main = "Whittaker plot", xlab = "Rank", ylab = "Ns")
  # Calculate diversity of order 1, i.e. Shannon's diversity
  Diversity(Paracou618.MC$Ps, 1)
  # Calculate it with estimation bias correction
  bcDiversity(Paracou618.MC$Ns, 1)

Run the code above in your browser using DataLab