slice.tree | R Documentation |
Time slicing through a phylogenetic tree.
slice.tree(tree, age, model, FAD, LAD, keep.all.ancestors = FALSE)
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 ( |
Thomas Guillerme
Guillerme T. & Cooper N. 2018. Time for a rethink: time sub-sampling methods in disparity-through-time analyses. Palaeontology. DOI: 10.1111/pala.12364.
paleotree::timeSliceTree
, chrono.subsets
.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.