# Alternative Diversity Results

### Description

Provides alternative methods of obtaining results on diversity statistics than provided directly by functions `diversity`

, `fisher.alpha`

, `specpool`

and `specnumber`

(all from vegan), although these same functions are called. Some other statistics are also calculated such as the reciprocal Berger-Parker diversity index and abundance (not a diversity statistic). The statistics can be calculated for the entire community, for each site separately, the mean of the sites can be calculated or a jackknife estimate can be calculated for the community.

### Usage

1 2 3 4 5 | ```
diversityresult(x, y="", factor, level, index="Shannon", method="all", sortit=F,
digits=8)
diversityvariables(x, y, digits=8)
diversitycomp(x,y="",factor1,factor2="",index="Shannon",
method="all",sortit=F,...)
``` |

### Arguments

`x` |
Community data frame with sites as rows, species as columns and species abundance as cell values. |

`y` |
Environmental data frame. |

`factor` |
Variable of the environmental data frame that defines subsets to calculate diversity statistics for. |

`level` |
Level of the variable to create the subset to calculate diversity statistics. |

`index` |
Type of diversity statistic with "richness" to calculate species richness, "abundance" to calculate abundance, "Shannon" to calculate the Shannon diversity index, "Simpson" to calculate 1-Simpson concentration index, "inverseSimpson" to calculate the reciprocal Simpson diversity index, "Logalpha" to calculate the log series alpha diversity index, "Berger" to calculate the reciprocal Berger-Parker diversity index, "Jevenness" to calculate one Shannon evenness index, "Eevenness" to calculate another Shannon evenness index, "jack1" to calculate the first-order jackknife gamma diversity estimator, "jack2" to calculate the second-order jackknife gamma diversity estimator, "chao" to calculate the Chao gamma diversity estimator and "boot" to calculate the bootstrap gamma diversity estimator. |

`method` |
Method of calculating the diversity statistics: "all" calculates the diversity of the entire community (all sites pooled), "s" calculates the diversity of each site separatedly, "mean" calculates the average diversity of the sites, "sd" calculates the standard deviation of the diversity of the sites, whereas "jackknife" calculates the jackknifed diversity for the entire data frame. Method "s" is not allowed for |

`sortit` |
Sort the sites by increasing values of the diversity statistic. |

`digits` |
Number of digits in the results. |

`factor1` |
Variable of the environmental data frame that defines subsets to calculate diversity statistics for. |

`factor2` |
Optional second variable of the environmental data frame that defines subsets to calculate diversity statistics for in a crosstabulation with the other variable of the environmental data frame. |

`...` |
Other arguments passed to function |

### Details

These functions provide some alternative methods of obtaining results with diversity statistics, although functions `diversity`

, `fisher.alpha`

, `specpool`

, `estimateR`

and `specnumber`

(all from vegan) are called to calculate the various statistics.

Function `diversityvariables`

adds variables to the environmental dataset (richness, Shannon, Simpson, inverseSimpson, Logalpha, Berger, Jevenness, Eevenness).

The reciprocal Berger-Parker diversity index is the reciprocal of the proportional abundance of the most dominant species.

J-evenness is calculated as: H / ln(S) where H is the Shannon diversity index and S the species richness.

E-evenness is calculated as: exp(H) / S where H is the Shannon diversity index and S the species richness.

The method of calculating the diversity statistics include following options: "all" calculates the diversity of the entire community (all sites pooled together), "s" calculates the diversity of each site separatedly, "mean" calculates the average diversity of the sites, whereas "Jackknife" calculates the jackknifed diversity for the entire data frame. Methods "s" and "mean" are not available for function diversitycomp. Gamma diversity estimators assume that the method is "all".

Functions `diversityresult`

and `diversitycomp`

allow to calculate diversity statistics for subsets of the community and environmental data sets. Function `diversityresult`

calculates the diversity statistics for the specified level of a selected environmental variable. Function `diversitycomp`

calculates the diversity statistics for all levels of a selected environmental variable separatedly. When a second environmental variable is provided, function `diversitycomp`

calculates diversity statistics as a crosstabulation of both variables.

### Value

The functions provide alternative methods of obtaining diversity results. For function `diversitycomp`

, the number of sites is provided as "n".

### Author(s)

Roeland Kindt (World Agroforestry Centre)

### References

Kindt, R. & Coe, R. (2005) Tree diversity analysis: A manual and software for common statistical methods for ecological and biodiversity studies.

http://www.worldagroforestry.org/output/tree-diversity-analysis

### Examples

1 2 3 4 5 6 7 8 | ```
library(vegan)
data(dune.env)
data(dune)
Diversity.1 <- diversityresult(dune, y=dune.env, factor='Management',
level='NM', index='Shannon' ,method='s', sortit=TRUE, digits=3)
Diversity.1
diversitycomp(dune, y=dune.env, factor1='Management', factor2="Moisture",
index='Shannon' ,method='all', sortit=TRUE, digits=3)
``` |