simevol: simulates adaptive evolution under given fitness function and...

View source: R/simevol1k.R

simevolR Documentation

simulates adaptive evolution under given fitness function and mutation function.

Description

This function simulates adaptive evolution by means of the oligomorphic stochastic model (OSM). The OSM assumes very rare mutations in comparison with the time scale of population dynamics, so that evolutionary dynamics can be described as a trait substitution sequence, engendered by repeated mutant invasions.

Usage

simevol(
  phe = a$phe,
  en = a$en,
  fitness = NULL,
  mutate = mutate0,
  pop_dynamics = pop_dynamics0,
  set_parms = NULL,
  plot_func = plot_func0,
  output = output0,
  output_tree = output_tree0,
  halt_func = NULL,
  yorick_plot = NULL,
  tmax = 1e+08,
  out_interval = 10,
  show_interval = 10,
  file_data = "test.dat",
  file_data_tree = "test_tree.dat",
  file_data_pid = "test_pid.dat",
  continue = FALSE,
  runid = 1,
  runname = "",
  mydir = ".simevol/",
  fitness_contour = TRUE,
  fitness_contour_phe = NULL,
  plot_mask = NULL,
  reset_win = TRUE,
  show_subwin = TRUE,
  trait_names = NULL,
  env_names = NULL,
  bgid = -1,
  palid = 1,
  palfunc = NULL,
  pparam = pparam0,
  amp_invf = 0.1,
  level_invf = 0.02,
  amp_invf_fix = FALSE,
  m_rate = 1,
  m_sd = 0.01,
  n_mutant_init = 1e-06,
  edge_extinct = 1e-08,
  edge_fit = 1e-13,
  nrad = 12,
  drad = 1,
  divrad = 2,
  param_desolve = list(method = "radau", hini = 1e-04, hmax = 1e+09, rtol = 1e-04, atol
    = 1e-20)
)

Arguments

phe

list: phenotypes of coexisting residents.

en

array: population densities of coexisting residents and environmental variables.

fitness

function: fitness function.

mutate

function: function for mutation.

pop_dynamics

function: function for population dynamics. When this function is not given, the "fitness" function is used for calculation of population dynamics.

Details

The population dynamics triggerred by each mutant invasion is calculated with R-package "deSolve".

Value

no direct output (the variable "a" contains all simulation data as well as parameters)

Author(s)

Hiroshi C. Ito


yorickuser/simevol documentation built on Sept. 6, 2024, 8:57 p.m.