drop_extinct: Drops extinct tips from tree

Description Usage Arguments Value Author(s) References Examples

View source: R/utilities.R

Description

Drops extinct tips from tree

Usage

1
drop_extinct(phy, tol = NULL)

Arguments

phy

a 'phylo' class object

tol

tolerance in decimal values for branch lengths

Value

A 'phylo' class object with extinct tips removed

Author(s)

LJ Harmon, and JW Brown This is a direct port of the geiger function, I import it here for convenience. This code is copied under GPL 3 license.

References

Pennell M, Eastman J, Slater G, Brown J, Uyeda J, Fitzjohn R, Alfaro M, Harmon L (2014). “geiger v2.0: an expanded suite of methods for fitting macroevolutionary models to phylogenetic trees.” Bioinformatics, 30, 2216-2218

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
mu <- 0.5 # death rate
lambda <- 2.0 # birth rate
numb_replicates <- 10
numb_extant_tips <- 4
# simulate trees under the GSA so first simulates a tree with
# numb_extant_tips * 100 tips counting each time we have a tree with 10 tips
# then randomly picks one of those trees

tree_list <- sim_sptree_bdp(sbr = lambda,
                sdr = mu,
                numbsim = numb_replicates,
                n_tips = numb_extant_tips)
pruned <- drop_extinct(tree_list[[1]])

treeducken documentation built on March 3, 2021, 1:11 a.m.