README.md

comrad: A more mechanistic approach to diversity-dependent diversification

An example output of the simulation

| Branch | Travis CI logo | Codecov logo | |------------------------|------------------------|------------------------ | master | R-CMD-check | Codecov test coverage | | develop | R-CMD-check | Codecov test coverage | | brute_force* | R-CMD-check | Codecov test coverage |

*see the Installation section

Description

comrad is an individual-based model of diversity-dependent diversification, where branching (and by extension, speciation), extinction and equilibrium diversity emerge from Lotka-Volterra like competition between individuals.

This package contains the algorithm for the model and functions used to run it, extract, analyse and visualise its output, including the phylogenetic tree of the community.

An overview of the model and the main features of the package can be found in the vignette.

The package accompanies the third chapter of my doctoral dissertation, and the corresponding manuscript, currently in prep. The functions it contains were used to produce the results and figures presented through the paper.

Installation

I maintain two versions of the package. The default version, suitable for all applications that do not include running the simulation for large communities, can be installed from the master branch:

remotes::install_github("TheoPannetier/comrad")

An alternative version, which lives on branch brute_force, is more suitable for running simulations with large communities ($N > 10^4$). Indeed, because the pairwise effects of competition must be calculated at every generation, the number of calculations grows quadratically with the size of the community, and the simulation may take a very long time to complete in such cases.

A solution has been implemented by \@HHildenbrandt to address this using parallel- (via xsmid) and multi-processing (via OpenMP), which greatly reduces the time the simulation takes to process the whole community. This version of the package lives on branch `brute_force`, and can be installed with

remotes::install_github("TheoPannetier/comrad", ref = "brute_force")

*To best exploit these solutions, compilation is optimised for the local system on which comrad is run via the compiler flags -march=native, -mtune=native. These flags are not portable, so this version of the package cannot pass the CRAN check.

In case of doubt over which version is installed, the user can call has_brute_force_opt(), which evaluates to FALSE for the main version and to TRUE for the brute_force option.

Contributing / Bug report / Support



TheoPannetier/comrad documentation built on April 8, 2023, 8:06 a.m.