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 , the index of Shannon-Weaver is defined by the expression
, where
represents the relative frequency of species
, because
, (where
denotes the number of individuals of species
and
total number of individuals in all
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, denotes the relative frequency of surname
in region (
community diversity context)
and
are all surnames in region
.
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