### Introduction

### Theory, R functions & Examples

en:div-ind_r

Section: Diversity analysis

- calculates species richness for individual samples, optionally number of species for different groups of samples. Applies on sample x species matrix of abundances, presences absences or other type of data (calculation of richness does not consider species abundances). Argument`specnumber (library vegan)`

`group`

allows to calculate group-based species richness (i.e. number of species occurring in samples classified into given group). Just a little more clever than simple`rowSums (x > 0)`

.- calculates`diversity (library vegan)`

**Shannon and Simpson index**. Applies on the sample x species matrix, where cells are species abundances. Argument`index`

is either`shannon`

(calculates Shannon entropy),`simpson`

(calculates Gini-Simpson index, i.e. 1-Simpson, since Simpson index decreases with richness), and`invsimpson`

(calculates reciprocal Simpson 1/D, which in fact is Simpson diversity - effective number of species calculated from Simpson's concentration index). Argument`base`

can modify the base of the logarithm which is used to calculate Shannon (default is natural logarithm, some prefer to use base = 2). The function works also if data are not genuine counts of individuals (abundances), but other measures (dominance, cover); in that case, the interpretation is not “randomly chosen individual” (Shannon) or “two randomly chosen individuals” (Simpson), but e.g. “randomly chosen bit's of biomass”.- calculates`d (library vegetarian)`

**Hill numbers**for alpha, beta and gamma diversity. Applies on sample x species matrix of abundances (or biomass, cover etc.). Argument`q`

modifies the coefficient*q*of the Hill numbers; default is`q = 1`

, which is Shannon diversity (effective number of species calculated from Shannon's entropy).`q`

can be any real number (also negative, although that makes not sense since this would give high weight to rare species). Allows to estimate confidence intervals via bootstrapping. For`level = 'alpha`

' it calculates diversity on the level of individual rows (samples), for`level = 'gamma`

' on the level of the whole dataset.`level = 'beta`

' calculates beta richness.

en/div-ind_r.txt · Last modified: 2021/03/03 19:58 by David Zelený