simToPhylo: Convert simulated result to a tree

Description Usage Arguments Details Value Author(s) References Examples

Description

Converts the $results element of the return to a phylo object

Usage

1
SimToPhylo(results, include.extinct=FALSE, drop.stem=TRUE)

Arguments

results

dataframe of results from SimulateHisse.

include.extinct

include (TRUE) or delete (FALSE) extinct terminal taxa.

drop.stem

include the lineage leading to the first saved speciation even (FALSE) or cull it (TRUE).

Details

This takes the $results object from a SimulateHisse run and converts it to an ape phylo object. If there are no taxa on the final tree, it returns NA; if there is one taxon, it returns a one taxon tree. This is behavior different from diversitree's tree simulators, which returns NULL in both the zero and one taxon case. Extinct taxa can be pruned or not. For simulations starting with one taxon, and/or for simulations with some extinction, the final tree can have a time when there is a single lineage before it radiates into the crown group. This stem can be included or not. The tip states are stored in $tip.state in the returned tree.

Value

phylo

a phylo object in cladewise order.

Author(s)

Brian O'Meara

References

Beaulieu, J.M, and B.C. O'Meara. 2016. Detecting hidden diversification shifts in models of trait-dependent speciation and extinction. Syst. Biol. 65:583-601.

Examples

1
2
3
4
5
6
simulated.result <- SimulateHisse(c(.3, .1), c(.1, 0), 
matrix(c(NA, 0.2, .3, NA), nrow=2), max.taxa=35, x0=1)	
par(mfcol=c(1,2))
plot(SimToPhylo(simulated.result$results, include.extinct=TRUE))
plot(SimToPhylo(simulated.result$results, include.extinct=FALSE))
 	

hisse documentation built on Nov. 16, 2021, 9:09 a.m.