slice.tree {dispRity} | R Documentation |
Time slicing a tree.
Description
Time slicing through a phylogenetic tree.
Usage
slice.tree(tree, age, model, FAD, LAD, keep.all.ancestors = FALSE)
Arguments
tree |
A |
age |
A single |
model |
One of the following models: |
FAD , LAD |
The first and last occurrence data. |
keep.all.ancestors |
Optional, whether to also include the ancestors of the tree slice ( |
Author(s)
Thomas Guillerme
References
Guillerme T. & Cooper N. 2018. Time for a rethink: time sub-sampling methods in disparity-through-time analyses. Palaeontology. DOI: 10.1111/pala.12364.
See Also
paleotree::timeSliceTree
, chrono.subsets
.
Examples
set.seed(1)
## Generate a random ultrametric tree
tree <- rtree(20)
## Add some node labels
tree$node.label <- letters[1:19]
## Add its root time
tree$root.time <- max(tree.age(tree)$ages)
## Slice the tree at age 1.5
tree_slice <- slice.tree(tree, age = 1.5, "deltran")
## The slice at age 0.5 but keeping all the ancestors
deep_slice <- slice.tree(tree, age = 0.5, "deltran",
keep.all.ancestors = TRUE)
## Visualising the trees
old_par <- par(mfrow = c(2,2))
plot(ladderize(tree), main = "full tree"); axisPhylo()
abline(v = tree$root.time - 1.5)
plot(ladderize(tree_slice), main = "tree slice"); axisPhylo()
plot(ladderize(deep_slice), main = "slice with ancestors"); axisPhylo()
par(old_par)
[Package dispRity version 1.8 Index]