fShannon {OnomasticDiversity} | R Documentation |
Calculate the Shannon-Weaver diversity index
Description
This function obtains the Shannon-Weaver diversity index introduced by Claude Elwood Shannon. This diversity measure came from information theory and measures the order (or disorder) observed within a particular system. It is a method for quantifying species biodiversity that can be adapted to the context of onomastics.
Usage
fShannon(x, k, n, location)
Arguments
x |
dataframe of the data values for each species not null (because if you have a sample, there might be species that are not represented).. |
k |
name of a variable which represents absolute frequency for each species. |
n |
name of a variable which represents total number of individuals. |
location |
represents the grouping element. |
Details
For a community i
, the index of Shannon-Weaver is defined by the expression
H^{\prime} = -\sum\limits_{k\in S_i} (p_{ki} \log_2 p_{ki})
, where p_{ki}
represents the relative frequency of species k
, because p_{ki} = \frac{N_{ki}}{N_i}
, (where N_{ki}
denotes the number of individuals of species k
and N_i
total number of individuals in all S_i
species at the community, species richness. This index is related to the weighted geometric mean of the proportional abundances of the types.
In onomastic context, p_{ki}
denotes the relative frequency of surname k
in region (\approx
community diversity context) i
and S_i
are all surnames in region i
.
Value
A dataframe containing the following components:
location |
represents the grouping element, for example the communities / regions. |
shannon |
the value of the Shannon-Weaver diversity index. |
Author(s)
Maria Jose Ginzo Villamayor
References
Shannon C.E. (1948). A mathematical theory of communication. Bell System Technical Journal, 27, 379–423.
Shannon C.E., Weaver W. (1949). The Mathematical Theory of Communication. Urbana: University of Illinois Press. USA, 96. pp. 117.
See Also
fMargalef
,
fMenhinick
,
fPielou
,
fSheldon
,
fSimpson
,
fSimpsonInf
,
fGeneralisedMean
, fGeometricMean
,
fHeip
.
Examples
data(surnamesgal14)
result = fShannon (x= surnamesgal14[surnamesgal14$number != 0,],
k="number", n="population", location = "muni" )
result
data(namesmengal16)
result = fShannon (x= namesmengal16[namesmengal16$number != 0,],
k="number", n="population", location = "muni" )
result
data(nameswomengal16)
result = fShannon (x= nameswomengal16[nameswomengal16$number != 0,],
k="number", n="population", location = "muni" )
result