Recent developments in modern coexistence theory have
advanced our understanding on how species are able to persist and
co-occur with other species at varying abundances. However, applying
this mathematical framework to empirical data is still challenging,
precluding a larger adoption of the theoretical tools developed by
empiricists. This package provides a complete toolbox for modelling
interaction effects between species, and calculate fitness and niche
differences. The functions are flexible, may accept covariates, and
different fitting algorithms can be used. A full description of the
underlying methods is available in García-Callejas, D., Godoy, O., and
Bartomeus, I. (2020)
cxr provides a complete toolbox for modelling interactions between species, calculate coexistence metrics (e.g. niche and fitness differences), and project species abundances. The functions are flexible and can include covariates, use different optimization algorithms, or accept user-defined mathematical population models as starting points. It furthermore includes a series of functions to model metapopulation dynamics of stage-structured populations.
The package can be installed from CRAN:
install.packages("cxr")
Furthermore, the development version can be installed via the remotes package:
remotes::install_github("RadicalCommEcol/cxr")
library("cxr")
The best way to start is to follow our vignettes. Note that for installing the vignettes alongside the package, you need to use following options at install:
remotes::install_github("RadicalCommEcol/cxr",
build_opts = c("--no-resave-data", "--no-manual"),
build_vignettes = TRUE)
The package has several key functions:
cxr_pm_fit()cxr_pm_multifit()cxr_er_fit()niche_overlap()species_fitness()avg_fitness_diff()competitive_ability()abundance_projection()And a set of internal functions, data and models. The functions with prefix cxr estimate model parameters from observational data, and functions without prefix calculate metrics related to species coexistence from model parameters. This basic workflow of the package is explained in different vignettes:
The complementary functionality on metapopulation dynamics is described in another vignette:
Once the package is installed, vignettes can be accessed in the standard way:
vignette("V1_Getting_started",package = "cxr")
vignette("V2_Data_formats",package = "cxr")
vignette("V3_Coexistence_metrics",package = "cxr")
vignette("V4_Models",package = "cxr")
vignette("V5_Abundance_projections",package = "cxr")
vignette("V6_Metapopulation_projections",package = "cxr")
When citing, please refer to both the package citation and the release paper García-Callejas, Godoy, and Bartomeus, 2020.
cxr is in continuous development. This is a partial list of features we aim to implement in future releases:
We welcome contributions (e.g. via pull request) and bug reports.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.