Learn R Programming

codyn - Community Dynamics Metrics

A package to analyze long-term ecological community datasets.

Univariate and multivariate temporal and spatial diversity indices, rank abundance curves, and community stability metrics. The functions implement metrics that are either explicitly temporal and include the option to calculate them over multiple replicates, or spatial and include the option to calculate them over multiple time points. Functions fall into five categories: static diversity indices, temporal diversity indices, spatial diversity indices, rank abundance curves, and community stability metrics. The diversity indices are temporal and spatial analogs to traditional diversity indices. Specifically, the package includes functions to calculate community richness, evenness and diversity at a given point in space and time. In addition, it contains functions to calculate species turnover, mean rank shifts, and lags in community similarity between two time points.

For an overview of codyn, see:

  • Hallett LM, Jones SK, MacDonald AAA, Jones MB, Flynn DFB, Ripplinger J, Slaughter P, Gries C, Collins SL (2016) codyn: An R package of community dynamics metrics. Methods in Ecology and Evolution, 7(10):1146–1151. https://doi.org/10.1111/2041-210X.12569

For a description of the newer spatial methods in codyn v2.x:

  • Avolio ML, Carroll IT, Collins SL, Houseman GR, Hallett LM, Isbell F, Koerner SE, Komatsu KJ, Smith MD, Wilcox KR (2019) A comprehensive approach to analyzing community dynamics using rank abundance curves. Ecosphere, 10(10):e02881. https://doi.org/10.1002/ecs2.2881

Installation

From CRAN, the package can be installed using standard tools:

install.packages("codyn")

Automated R CMD check with Docker via rhub

To simplify the process of running R CMD check on the package, one can easily run the build and tests using the rhub package. Use rhub::platforms() to get a list of platforms that can be used to build and test.

library(rhub)
chks <- check(platform = c("debian-gcc-devel", "fedora-gcc-devel"), show_status = FALSE)

and the checks can be run locally using rhub as well using a docker container:

library(rhub)
local_check_linux(image="rhub/fedora-gcc-devel")

Acknowledgments

Work on this package was supported by NSF-ABI grant #1262458 to C. Gries, M. Jones, and S. Collins. Additional support was provided for working group collaboration by the National Center for Ecological Analysis and Synthesis, a Center funded by the University of California, Santa Barbara, and the State of California, and a SESYNC Synthesis Postdoctoral Fellowship to MLA.

Copy Link

Version

Install

install.packages('codyn')

Monthly Downloads

711

Version

2.0.6

License

Apache License (== 2.0)

Issues

Pull Requests

Stars

Forks

Maintainer

Matthew B Jones

Last Published

September 18th, 2026

Functions in codyn (2.0.6)

knz_001d

Data from Konza Prairie, watershed 001d
rate_change

Rate of community change over successive time intervals
pplots

Phosphorus plots data from Avolio et al. 2014
mean_rank_shift

Mean Rank Shifts
curve_change

Curve Change
curve_difference

Curve Difference
multivariate_difference

Using dissimilarity-based measures to calculate differences in composition and dispersion between pairs of treatments at a single time point
rank_shift

Mean Rank Shifts
cyclic_shift

Cyclic Shift Permutations
rate_change_interval

Differences in community composition over successive time lag intervals
synchrony

Species synchrony
multivariate_change

Using dissimilarity-based measures to calculate changes in composition and dispersion
variance_ratio

Variance Ratio
turnover

Species Turnover
confint.cyclic_shift

Confidence Intervals from a Cyclic Shift Permutation
collins08

Konza data from Collins et al. 2008
community_structure

Community Structure
RAC_difference

Rank Abundance Curve Differences
abundance_change

Species Abundance Changes
abundance_difference

Abundance Differences
RAC_change

Rank Abundance Curve Changes
community_diversity

Community Diversity
community_stability

Community Stability
codyn-package

Community Dynamics Metrics