Description Usage Arguments Details Value Author(s) See Also Examples
As drop.tip
from the ape package, drop.tip2
removes terminal branches of a phylogenetic tree, possibly removing the corresponding internal branches, but, in addition, can handle further, non-standard list elements of "phylo"
object (i.e. vectors of length phy$Nnode
, which may contain support values, ages or rate estimates, etc. ).
1 2 |
phy |
An object of class |
tip |
A vector of mode numeric or character specifying the tips to delete. |
trim.internal |
A logical specifying whether to delete the corresponding internal branches. |
subtree |
A logical specifying whether to output in the tree how many tips have been deleted and where. |
root.edge |
An integer giving the number of internal branches to be used to build the new root edge. This has no effect if |
rooted |
A logical indicated whether the tree must be treated as rooted or not. This allows to force the tree to be considered as unrooted (see examples in |
See drop.tip
for details.
An object of class "phylo"
.
Christoph Heibl based on drop.tip
by Emanuel Paradis.
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 | # Hordeum species tree
# --------------------
data(hordeum)
# These tips ...
# --------------
tips2remove = c("Hordeum_pubiflorum", "Hordeum_patagonicum",
"Hordeum_comosum", "Hordeum_gussoneanum","Hordeum_marinum")
# ... will be pruned from the tree:
# ---------------------------------
hordeum_pruned <- drop.tip2(hordeum, tips2remove)
# Compare the results using the height parameter
# from a divergence time analysis:
# ----------------------------------------------
org.par <- par()
par(mfrow = c(2,1), mar = c(0, 0, 1, 0))
tcol <- tip.color(hordeum, list(tips2remove),
col = "red")
plot.phylo(hordeum, tip.color = tcol)
title("Hordeum species tree")
nodelabels(hordeum$height, cex = 0.8)
plot.phylo(hordeum_pruned)
title("Hordeum species tree with tips removed")
nodelabels(hordeum_pruned$height, cex = 0.8)
par(org.par)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.