apply_speciation: Resolve cladogenetic and anagetic speciation in the island...

View source: R/apply_speciation.R

apply_speciationR Documentation

Resolve cladogenetic and anagetic speciation in the island community

Description

Scan the island community and if conditions for cladogenetic speciation are met, splits species accordingly. Then does the same for anagenetic speciation.

Usage

apply_speciation(
  island_comm,
  mainland_comm,
  used_species_names,
  trait_dist_sp = comrad::default_trait_dist_sp()
)

Arguments

island_comm

a tibble with one row per individual in the community and three columns:

  • z contains (numeric) traits values

  • species contains species names (characters)

  • ancestral_species contains ancestral species names (characters)

  • founder (characters), the mainland species that this species' clade originates from.

mainland_comm

a tibble defining what species exist in the mainland and their trait distribution. One row per species, three columns:

  • species, (character) the name of the species

  • mean_z, (numeric) mean value of the trait for that species

  • z_sd, (numeric) standard deviation of the trait for that species

trait_dist_sp

numeric, the minimal trait distance between two clusters of individuals triggering speciation.

Details

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.

Note

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.

Author(s)

Théo Pannetier


TheoPannetier/comsie documentation built on Nov. 21, 2022, 4:35 p.m.