sim_bd_twin_tree: Simulate a Birth-Death (BD) twin tree from the true phylogeny

View source: R/sim_bd_twin_tree.R

sim_bd_twin_treeR Documentation

Simulate a Birth-Death (BD) twin tree from the true phylogeny

Description

Simulate a Birth-Death (BD) twin tree from the true phylogeny

Usage

sim_bd_twin_tree(
  true_phylogeny,
  method = "random_tree",
  n_replicates = 10000,
  os = rappdirs::app_dir()$os
)

Arguments

true_phylogeny

the true phylogeny; the actual evolutionary history of the species, of class phylo

method

determines how to create the twin tree

  • 'random_tree' just produces a random tree;

  • 'max_clade_cred' simulates n_replicates trees and uses maxCladeCred to create a consensus tree;

  • 'max_likelihood' simulates n_replicates trees and selects the most likely;

n_replicates

number of replicas to evaluate in order to create the twin tree

os

name of the operating system, can be mac, unix or win. Use check_os if the operating system is valid.

Value

a twin BD tree of class phylo, obtained from the corresponding phylogeny.

Author(s)

Richèl J.C. Bilderbeek, Giovanni Laudanno

See Also

Use sim_yule_twin_tree to simulate a Yule twin tree Use get_sim_bd_twin_tree_fun to get a partially evaluated function to use in the twinning_params (as created by create_twinning_params)

Examples

phylogeny <- ape::read.tree(text = "((A:2, B:2):1, C:3);")
sim_bd_twin_tree(phylogeny)

richelbilderbeek/pirouette documentation built on Oct. 18, 2023, 3:09 p.m.