metadiv | R Documentation |
Generic function for calculating metacommunity-level diversity.
metadiv(data, qs) ## S4 method for signature 'powermean' metadiv(data, qs) ## S4 method for signature 'relativeentropy' metadiv(data, qs) ## S4 method for signature 'metacommunity' metadiv(data, qs)
data |
|
qs |
|
data
may be input as one of three different classes:
powermean
: raw or normalised metacommunity alpha, rho or gamma
diversity components; will calculate metacommunity-level raw or normalised
metacommunity alpha, rho or gamma diversity
relativeentropy
: raw or normalised metacommunity beta
diversity components; will calculate metacommunity-level raw or normalised
metacommunity beta diversity
metacommunity
: will calculate all metacommunity measures of
diversity
metadiv()
returns a standard output of class rdiv
Reeve, R., T. Leinster, C. Cobbold, J. Thompson, N. Brummitt, S. Mitchell, and L. Matthews. 2016. How to partition diversity. arXiv 1404.6520v3:1–9.
inddiv
for type-level diversity and
subdiv
for subcommunity-level diversity.
# Define metacommunity pop <- data.frame(a = c(1,3), b = c(1,1)) pop <- pop / sum(pop) meta <- metacommunity(pop) # Calculate metacommunity gamma diversity (takes the power mean) g <- raw_gamma(meta) metadiv(g, 0:2) # Calculate metacommunity beta diversity (takes the relative entropy) b <- raw_beta(meta) metadiv(b, 0:2) # Calculate all measures of metacommunity diversity metadiv(meta, 0:2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.