Description Usage Arguments Value Author(s) References See Also Examples
track.shift returns all changes in speciation or extinction between the root of a tree and a specific node or tip in a phylogenetic tree simulated with TreeSimGM. It can track back changes on the speciation process (shift='sp') or on the extinction process (shift='ext'). Changes are the multipliers of the drawn waiting times.
1 | track.shift(shift="sp",tree, node)
|
shift |
specifies which macroevolutionary process shall be tracked. Can be "sp" or "ext" for tracking speciation or extinction shifts repectively (default is "sp"). |
tree |
is the simulated tree object. |
node |
is the node number or tip label that should be tracked. The numbers are the number of the attributes tip.label or as specified in '$edge' on the phylo tree object. |
out |
is a vector of changes, i.e. scaling factors of the waiting times process, from MRCA until the desired node. Each reported scaling factor is named with a node number (as in $edge). The scaling factor change happened at the start of the branch ancestral to that named node. |
Oskar Hagen, Tanja Stadler
O. Hagen and T. Stadler (2017). TreeSimGM: Simulating phylogenetic trees under general Bellman Harris models with lineage-specific shifts of speciation and extinction in R. Methods in Ecology and Evolution.
O. Hagen, K. Hartmann, M. Steel and T. Stadler (2015). Age-dependent Speciation can Explain the Shape of Empirical Trees. Systematic Biology. 64, v.3, p.432-440.
sim.age, sim.taxa
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | # setting seed for reproductibility
set.seed(2142)
# Simulating a tree under an asymmetric speciation mode with frequent changes in
# speciation and extinction (repectively 50% and 30% probability)
shif_spext_asym <- sim.taxa(numbsim=1, n=5, waitsp="rexp(1)",
waitext="rexp(0.5)", symmetric = FALSE,
shiftsp=list(prob=0.5, strength="rnorm(0.5,0.01)"),
shiftext=list(prob=0.3, strength="runif(0,0.5)"))
# visualiying the generated stochastic tree
plot(shif_spext_asym[[1]])
# tracking speciation shifts for species 3
# note that this function returns the shifts on the branches
# starting from the mrca
track.shift(shift="sp", tree=shif_spext_asym[[1]], node=3)
# tracking speciation shifts for species 7
track.shift(shift="sp", tree=shif_spext_asym[[1]], node=7)
# tracking extinction shifts for species 7
track.shift(shift="ext", tree=shif_spext_asym[[1]], node=7)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.