
Last chance! 50% off unlimited learning
Sale ends in
DropTip()
removes specified tips from a phylogenetic tree, collapsing
incident branches.
DropTip(tree, tip)# S3 method for phylo
DropTip(tree, tip)
# S3 method for multiPhylo
DropTip(tree, tip)
A tree of class phylo
.
Character vector specifying labels of leaves in tree to be dropped, or integer vector specifying the indices of leaves to be dropped. Specifying the index of an internal node will drop all descendants of that node.
DropTip()
returns a tree of class phylo
, in Preorder, with the
requested leaves removed.
This function is more robust than ape::drop.tip()
as it does not
require any particular internal node numbering schema. It is not presently
as fast, though it is ripe for optimization; if you are finding this
function is a rate-limiting step, please get in touch and I'll prioritise
writing a faster implementation.
Other tree manipulation:
AddTip()
,
CollapseNode()
,
ConsensusWithout()
,
EnforceOutgroup()
,
LeafLabelInterchange()
,
MakeTreeBinary()
,
RenumberTips()
,
RenumberTree()
,
Renumber()
,
RootTree()
,
SingleTaxonTree()
,
SortTree()
,
Subtree()
# NOT RUN {
tree <- BalancedTree(8)
plot(tree)
plot(DropTip(tree, c('t4', 't5')))
# }
Run the code above in your browser using DataLab