community_stability {codyn} | R Documentation |
Community Stability
Description
Calculates the stability of the overall community over time as the temporal mean / temporal standard deviation of aggregate species abundances (Tilman 1999).
Usage
community_stability(df, time.var, abundance.var, replicate.var = NA)
Arguments
df |
A data frame containing time, species and abundance columns and an optional column of replicates |
time.var |
The name of the time column |
abundance.var |
The name of the abundance column |
replicate.var |
The name of the optional replicate column |
Details
The input data frame needs to contain columns for time, species and abundance; time.var, species.var and abundance.var are used to indicate which columns contain those variables. If multiple replicates are included in the data frame, that column should be specified with replicate.var. Each replicate should reflect a single experimental unit - there should be a single community represented within each time point and replicate.
Value
The community_stability function returns a numeric stability value unless a replication column is specified in the input data frame. If replication is specified, the function returns a data frame with the following columns:
stability: A numeric column with the stability values.
replicate.var: A column that shares the same name and type as the replicate.var column in the input data frame.
References
Tilman, D. "The Ecological Consequences of Changes in Biodiversity: A Search for General Principles." Ecology 80, no. 5 (July 1999): 1455-74. doi:10.1890/0012-9658(1999)080[1455:TECOCI]2.0.CO;2.
Examples
data(knz_001d)
community_stability(knz_001d[knz_001d$subplot=="A_1",],
time.var = "year",
abundance.var = "abundance") # for one subplot
community_stability(knz_001d,
time.var = "year",
abundance.var = "abundance",
replicate.var = "subplot") # across all subplots