diversity               package:vegan               R Documentation

_E_c_o_l_o_g_i_c_a_l _D_i_v_e_r_s_i_t_y _I_n_d_i_c_e_s _a_n_d _R_a_r_e_f_a_c_t_i_o_n _S_p_e_c_i_e_s _R_i_c_h_n_e_s_s

_D_e_s_c_r_i_p_t_i_o_n:

     Shannon, Simpson, Rnyi, Hill and Fisher diversity indices and
     rarefied species richness for community ecologists.

_U_s_a_g_e:

     diversity(x, index = "shannon", MARGIN = 1, base = exp(1))
     rarefy(x, sample, se = FALSE, MARGIN = 1)
     renyi(x, scales=c(0,0.25,0.5,1,2,4,8,16,32,64,Inf), hill = FALSE)
     fisher.alpha(x, MARGIN = 1, se = FALSE, ...)
     specnumber(x, MARGIN = 1)

_A_r_g_u_m_e_n_t_s:

       x: Community data matrix.

   index: Diversity index, one of 'shannon', 'simpson' or 'invsimpson'.

  MARGIN: Margin for which the index is computed. 

    base: The logarithm 'base' used in 'shannon'.

  sample: Subsample size for rarefying community.

      se: Estimate standard errors.

  scales: Scales of Rnyi diversity.

    hill: Calculate Hill numbers.

     ...: Parameters passed to 'nlm'

_D_e_t_a_i_l_s:

     Shannon or Shannon-Weaver (or Shannon-Wiener) index is defined as
     H = -sum p_i log(b) p_i, where p_i is the proportional abundance
     of species i and b is the base of the logarithm.  It is most
     popular to use natural logarithms, but some argue for base b = 2
     (which makes sense, but no real difference).

     Both variants of Simpson's index are based on D = sum p_i^2.
     Choice 'simpson' returns 1-D and 'invsimpson' returns 1/D.

     Shannon and Simpson indices are both special cases of Rnyi
     diversity

                      H.a = 1/(1-a) log sum(p^a)

     where a is a scale parameter, and Hill (1975) suggested to use
     so-called ``Hill numbers'' defined as N.a = exp(H.a).  Some Hill
     numbers are the number of species with a = 0, exp(H') or the
     exponent of Shannon diversity with a = 1, inverse Simpson with a =
     2 and 1/max(p) with a = Inf. According to the theory of diversity
     ordering, one community can be regarded as more diverse than
     another only if its Rnyi diversities are all higher  (Tthmrsz
     1995). 

     Function 'rarefy' gives the expected species richness in random
     subsamples of size 'sample' from the community. The size of
     'sample' should be smaller than total community size, but the
     function will  silently work for larger 'sample' as well and
     return non-rarefied species richness (and standard error = 0).
     Rarefaction can be performed only with genuine counts of
     individuals. The function 'rarefy' is based on Hurlbert's (1971)
     formulation, and the standard errors on Heck et al. (1975).  

     Function 'fisher.alpha' estimates the alpha parameter of Fisher's
     logarithmic series (see 'fisherfit').  The estimation is possible
     only for genuine counts of individuals. The function can
     optionally return standard errors of alpha.  These should be
     regarded only as rough indicators of the accuracy: the confidence
     limits of alpha are strongly non-symmetric and standard errors
     cannot be used in Normal inference.

     Function 'specnumber' finds the number of species. With 'MARGIN =
     2', it finds frequencies of species. The function is extremely
     simple, and shortcuts are easy in plain R.

     Better stories can be told about Simpson's index than about
     Shannon's index, and still more grandiose stories about
     rarefaction (Hurlbert 1971).  However, these indices are all very
     closely related (Hill 1973), and there is no reason to despise one
     more than others (but if you are a graduate student, don't drag me
     in, but obey your Professor's orders). In particular, exponent of
     the Shannon index is linearly related to inverse Simpson (Hill
     1973) although the former may be more sensitive to rare species.
     Moreover, inverse Simpson is asymptotically equal to rarefied
     species richness in sample of two individuals, and Fisher's alpha
     is very similar to inverse Simpson.

_V_a_l_u_e:

     Vector of diversity indices or rarefied species richness values.
     With option 'se = TRUE', function 'rarefy' returns a 2-row matrix
     with rarefied richness ('S') and its standard error ('se').
     Function 'renyi' returns a data frame of selected indices.  With
     option 'se = TRUE', function 'fisher.alpha' returns a data frame
     with items for alpha ('alpha'), its approximate standard errors
     ('se'), residual degrees of freedom ('df.residual'), and the
     'code' returned by 'nlm' on the success of estimation.

_A_u_t_h_o_r(_s):

     Jari Oksanen, Roeland Kindt r.kindt@cgiar.org ('renyi') and  Bob
     O'Hara bob.ohara@helsinki.fi ('fisher.alpha').

_R_e_f_e_r_e_n_c_e_s:

     Fisher, R.A., Corbet, A.S. & Williams, C.B. (1943). The relation
     between the number of species and the number of individuals in a
     random sample of animal population. _Journal of Animal Ecology_
     12, 42-58.

     Heck, K.L., van Belle, G. & Simberloff, D. (1975). Explicit
     calculation of the rarefaction diversity measurement and the
     determination of sufficient sample size. _Ecology_ 56, 1459-1461.  

     Hill, M.O. (1973). Diversity and evenness: a unifying notation and
     its consequences. _Ecology_ 54, 427-473.

     Hurlbert, S.H. (1971). The nonconcept of species diversity: a
     critique and alternative parameters. _Ecological Monographs_ 54,
     187-211.

     Tthmrsz, B. (1995). Comparison of different methods for
     diversity ordering. _Journal of Vegetation Science_ 6, 283-290.

_E_x_a_m_p_l_e_s:

     data(BCI)
     H <- diversity(BCI)
     simp <- diversity(BCI, "simpson")
     invsimp <- diversity(BCI, "inv")
     r.2 <- rarefy(BCI, 2)
     alpha <- fisher.alpha(BCI)
     pairs(cbind(H, simp, invsimp, r.2, alpha), pch="+", col="blue")
     ## Species richness (S) and Pielou's evenness (J):
     S <- specnumber(BCI) ## rowSums(BCI > 0) does the same...
     J <- H/log(S)

