rphylo_H: Phylogenetic (host) tree simulation

View source: R/rcophylo.R

rphylo_HR Documentation

Phylogenetic (host) tree simulation

Description

This function simulates a random phylogenetic tree. This tree can then be used as a host tree on which parasites can evolve, using the rcophylo_PonH function.

Usage

rphylo_H(
  tmax,
  nHmax = Inf,
  lambda = 1,
  mu = 0.5,
  K = Inf,
  exportFormat = "phylo",
  timestep = 0.001
)

Arguments

tmax

a numeric value giving the length of the simulation.

nHmax

a numeric value giving the number of host species at which the simulation is stopped.

lambda

a numeric value giving the host speciation rate.

mu

a numeric value giving the host extinction rate.

K

a numeric value giving the carrying capacity for the host species.

exportFormat

either "phylo" (exported in Ape phylo format, the default setting) or "raw" (just a list of branches as used within the function itself)

timestep

a numeric value giving the time step by which the simulation proceeds. Increase to make the simulation faster or decrease to make it more precise.

Value

By default, an object of class "phylo" is returned, as specified in the R-package "ape". If the argument exportFormat is set to "raw" the function returns a dataframe containing information on all the branches in the tree. (This dataframe are what the function uses internally.)

Examples

rphylo_H(tmax=5)

JanEngelstaedter/cophy documentation built on Nov. 7, 2023, 9:37 a.m.