draw_comm_next_gen: Draw a new community from the current one

View source: R/draw_comm_next_gen.R

draw_comm_next_genR Documentation

Draw a new community from the current one

Description

From the trait values of the current community, compute the fitness, draw offspring, apply mutations and resolve speciation events.

Usage

draw_comm_next_gen(
  comm,
  growth_rate = default_growth_rate(),
  competition_sd = default_competition_sd(),
  trait_opt = default_trait_opt(),
  carrying_cap_opt = default_carrying_cap_opt(),
  carrying_cap_sd = default_carrying_cap_sd(),
  mutation_sd = default_mutation_sd(),
  trait_dist_sp = default_trait_dist_sp()
)

Arguments

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 acnestral species names (characters)

growth_rate

numeric ⁠>= 0⁠, the baseline growth rate. Generations being discrete, high values will cause chaos.

competition_sd

numeric ⁠>= 0⁠.Parameter \sigma_{\alpha} of the competition coefficient. Modulates the the strength of competition between two individuals given their distance in trait space.

trait_opt

numeric. The optimal trait value, z_{opt}. get_carrying_cap(trait_opt) = carrying_cap_opt.

carrying_cap_opt

numeric, value of the carrying capacity at trait_opt

carrying_cap_sd

numeric ⁠>= 0⁠. Parameter \sigma_K of the carrying capacity. Modulates how fast the carrying capacity decays when moving away from the optimal trait value.

mutation_sd

numeric ⁠>= 0⁠, the standard deviation of the normal distribution from which mutations are drawn.

trait_dist_sp

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

Author(s)

Théo Pannetier


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