Learn R Programming

entropart (version 1.1.3)

CommunityProfile: Diversity or Entropy Profile of a community

Description

Calculates the diversity or entropy profile of a community, applying a community function to a vector of orders.

Usage

CommunityProfile(FUN, NorP, q.seq, ..., CheckArguments = TRUE)

Arguments

FUN
The function to be applied to each value of $q$.
NorP
A numeric vector or a two-column matrix. Contains either abundances or probabilities. Two-column matrices should contain the observed abundances (or probabilities) in the first column and the expected ones in the second column, to allow using beta diversi
q.seq
A numeric vector.
...
Additional arguments to be passed to FUN.
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 list:
  • xThe order $q$ values
  • yThe entropy or diversity values returned by FUN
  • The list can be plotted.

Details

This function is used to calculate diversity or entropy profiles based on community functions such as Tsallis or ChaoPD. The first two arguments of the function must be a probability or abundance vector or a two-column matrix (for beta diversity functions) and a number ($q$). Additional arguments cannot be checked. Unexpected results may be returned if FUN is not used properly.

Examples

Run this code
# Load Paracou data (number of trees per species in two 1-ha plot of a tropical forest)
  data(Paracou618)
  # Estimate diversity.
  Profile <- CommunityProfile(bcDiversity, Paracou618.MC$Ns, seq(0, 2, 0.1))
  plot(Profile, type="l", main="Paracou Plots Diversity", xlab="q", ylab="Diversity")
  # Compare to non bias-corrected diversity
  lines(CommunityProfile(Diversity, Paracou618.MC$Ps, seq(0, 2, 0.1)), lty=3)
  legend("topright", c("Bias Corrected", "Biased"), lty=c(1,3), inset=0.01)

Run the code above in your browser using DataLab