Description Usage Arguments Value References Examples
View source: R/community_structure.R
Calculates species richness and evenness of a community. Evenness may be calculated as Simpson's (1/D/S), EQ, or Evar, but only one metric of evenness can be calculated at a time and must be specified.
1 2 3 4 5 6 7 | community_structure(
df,
time.var = NULL,
abundance.var,
replicate.var = NULL,
metric = c("Evar", "SimpsonEvenness", "EQ")
)
|
df |
A data frame containing species and abundance columns and optional columns of time and/or replicate. |
time.var |
The name of the optional time column |
abundance.var |
The name of the abundance column |
replicate.var |
The name of the optional replicate column. If specified, replicate must be unique within the dataset and cannot be nested within treatments or blocks. |
metric |
The measure of evenness to return:
|
The community_structure function returns a data frame with the following attributes:
time.var: A column that has the same name and type as the time.var column, if time.var is specified.
replicate.var: A column that has same name and type as the replicate.var column, if specified.
richness: A numeric column of species richness
Evar: A numeric column of Evar if evenness = "Evar"
EQ: A numeric column of EQ if evenness = "EQ"
SimpsonEvenness: A numeric column of Simpson's evenness if evenness = "SimpsonEveness"
Smith, B. and Wilson, J. B. 1996. A consumer's guide to evenness indices. Oikos 76: 70-82.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | data(pplots)
#Example with both time and replicates
df <- subset(pplots, plot == 25 | plot == 6)
community_structure(df,
time.var="year",
replicate.var = "plot",
abundance.var = "relative_cover") # for Evar evenness measure
df <- subset(pplots, plot == 25 | plot == 6)
community_structure(df,
time.var="year",
replicate.var = "plot",
abundance.var = "relative_cover",
metric = "SimpsonEvenness") # for Simpson's evenness measure
#Example with no replicates
df <- subset(pplots, plot == 25)
community_structure(df,
time.var="year",
abundance.var = "relative_cover",
metric = "EQ") # for EQ evenness measure
#Example with only a single time point and no replicates
df <- subset(pplots, plot == 25 & year == 2002)
community_structure(df,
abundance.var = "relative_cover") # for Evar evenness measure
|
year plot richness Evar
1 2002 6 23 0.2816103
2 2003 6 18 0.2039001
3 2004 6 22 0.3091447
4 2005 6 15 0.2917799
5 2002 25 18 0.2598594
6 2003 25 15 0.2065058
7 2004 25 20 0.2441690
8 2005 25 16 0.1912342
year plot richness SimpsonEvenness
1 2002 6 23 0.1761222
2 2003 6 18 0.2784896
3 2004 6 22 0.1327396
4 2005 6 15 0.2499747
5 2002 25 18 0.2262414
6 2003 25 15 0.2646880
7 2004 25 20 0.1463984
8 2005 25 16 0.3654740
year richness EQ
1 2002 18 0.1189180
2 2003 15 0.1057368
3 2004 20 0.1243605
4 2005 16 0.1033874
richness Evar
1 18 0.2598594
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.