
Subtree()
safely extracts a clade from a phylogenetic tree.
Subtree(tree, node)
The number of the node at the base of the clade to be extracted.
Subtree()
returns a tree of class phylo
that represents a
clade extracted from the original tree.
Modified from the ape function extract.clade
, which
sometimes behaves erratically.
Unlike extract.clade, this function supports the extraction of 'clades'
that constitute a single tip.
Other tree manipulation:
AddTip()
,
CollapseNode()
,
ConsensusWithout()
,
DropTip()
,
EnforceOutgroup()
,
LeafLabelInterchange()
,
MakeTreeBinary()
,
RenumberTips()
,
RenumberTree()
,
Renumber()
,
RootTree()
,
SingleTaxonTree()
,
SortTree()
# NOT RUN {
tree <- Preorder(BalancedTree(8))
plot(tree)
ape::nodelabels()
ape::nodelabels(13, 13, bg='yellow')
plot(Subtree(tree, 13))
# }
Run the code above in your browser using DataLab