View source: R/apply_speciation.R
apply_speciation | R Documentation |
Scan the island community and if conditions for cladogenetic speciation are met, splits species accordingly. Then does the same for anagenetic speciation.
apply_speciation( island_comm, mainland_comm, used_species_names, trait_dist_sp = comrad::default_trait_dist_sp() )
island_comm |
a tibble with one row per individual in the community and three columns:
|
mainland_comm |
a tibble defining what species exist in the mainland and their trait distribution. One row per species, three columns:
|
trait_dist_sp |
numeric, the minimal trait distance between two clusters of individuals triggering speciation. |
For cladogenesis:
For each species, check if there is any gap >= trait_dist_sp
in trait
values, and split the relevant species in two when one is found. The less
numerous half becomes the new species.
For anagenesis:
Only concerns non-endemic species, i.e. species that are still the same as
one of the populations in mainland_comm
. Such a species becomes a new
species if the average trait value of its members differs from the average
trait value of the mainland population by trait_dist_sp
.
apply_speciation()
can currently only split one species into two. If
multiple gaps emerge in a species at a single time step, only the first one
will be treated. As long as branching does not happen at every generation,
this is unlikely to be an issue, because an unresolved gap will be caught on
the next time step. In phylogenetic terms, this results in polytomies being
resolved as soft polytomies.
Besides, simultaneous branching events in different species are handled
perfectly fine.
Théo Pannetier
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.