## Overview

As long-term datasets increase in scope and length, new analytical tools are being developed to capture patterns of species interactions over time. The package codyn includes recently developed metrics of ecological community dynamics. Functions in codyn implement metrics that are explicitly temporal, and include the option to calculate them over multiple replicates. Functions fall into two categories: temporal diversity indices and community stability metrics.

## Temporal Diversity Indices

Many traditional measure of community structure represent a ‘snapshot in time’ whereas ecological communities are dynamic and many are experiencing directional change with time. The diversity indices in codyn are temporal analogs to traditional diversity indices such as richness and rank-abundance curves. They include:

• turnover calculates total turnover as well as the proportion of species that either appear or disappear between timepoints.

• mean_rank_shift quantifies relative changes in species rank abundances by taking the sum difference of species ranks in consecutive time points. This metric goes hand-in-hand with “rank clocks,” a useful visualization tool for shifts in species ranks.

• rate_change analyzes differences in species composition between samples at increasing time lags. It reflects the rate of directional change in community composition.

• rate_change_interval produces a data frame containing differences in species composition between samples at increasing time intervals.

## Community Stability Metrics

Ecologists have long debated the relationship between species diversity and stability. Unstable species populations may stabilize aggregate community properties if a decrease in one species is compensated for by an increase in another. In a time series, this should be reflected by a pattern in which species negatively covary or fluctuate asynchronously while total community stability remains relatively stable. codyn includes a function to characterize community stability, community_stability, and three metrics to characterize species covariance and asynchrony:

• variance_ratio characterizes species covariance (Schluter 1984; Houlahan et al. 2007), and includes a null-modeling approach to test significance (Hallett et al. 2014). Null modeling is built-in to the variance_ratio function. Two additional functions, cyclic_shift and confint.cyclic_shift, allow this method to be generalized to other test statistics.

• synchrony has two options. The first compares the variance of the aggregated community with the variance of individual components (Loreau and Mazancourt 2008). The second compares the average correlation of each individual species with the rest of the aggregated community (K. Gross et al. 2014).

## Citations

Gross, Kevin, Bradley J. Cardinale, Jeremy W. Fox, Andrew Gonzalez, Michel Loreau, H. Wayne Polley, Peter B. Reich, and Jasper van Ruijven. 2014. “Species Richness and the Temporal Stability of Biomass Production: A New Analysis of Recent Biodiversity Experiments.” The American Naturalist 183 (1): 1–12. doi:10.1086/673915.

Hallett, Lauren M., Joanna S. Hsu, Elsa E. Cleland, Scott L. Collins, Timothy L. Dickson, Emily C. Farrer, Laureano A. Gherardi, et al. 2014. “Biotic Mechanisms of Community Stability Shift Along a Precipitation Gradient.” Ecology 95 (6): 1693–1700. http://www.esajournals.org/doi/abs/10.1890/13-0895.1.

Houlahan, J. E., D. J. Currie, K. Cottenie, G. S. Cumming, S. K. M. Ernest, C. S. Findlay, S. D. Fuhlendorf, et al. 2007. “Compensatory Dynamics Are Rare in Natural Ecological Communities.” Proceedings of the National Academy of Sciences 104 (9): 3273–7. http://www.pnas.org/content/104/9/3273.short.

Loreau, Michel, and Claire de Mazancourt. 2008. “Species Synchrony and Its Drivers: Neutral and Nonneutral Community Dynamics in Fluctuating Environments.” The American Naturalist 172 (2): E48–E66. doi:10.1086/589746.

Schluter, Dolph. 1984. “A Variance Test for Detecting Species Associations, with Some Example Applications.” Ecology 65 (3): 998–1005. doi:10.2307/1938071.