View source: R/tree_rearrangement.R
LeafLabelInterchange | R Documentation |
LeafLabelInterchange()
exchanges the position of leaves within a tree.
LeafLabelInterchange(tree, n = 2L)
tree |
A tree of class |
n |
Integer specifying number of leaves whose positions should be exchanged. |
Modifies a tree by switching the positions of n leaves. To avoid later swaps undoing earlier exchanges, all n leaves are guaranteed to change position. Note, however, that no attempt is made to avoid swapping equivalent leaves, for example, a pair that are each others' closest relatives. As such, the relationships within a tree are not guaranteed to be changed.
LeafLabelInterchange()
returns a tree of class phylo
on which
the position of n
leaves have been exchanged.
The tree's internal topology will not change.
Martin R. Smith (martin.smith@durham.ac.uk)
Other tree manipulation:
AddTip()
,
CollapseNode()
,
ConsensusWithout()
,
DropTip()
,
EnforceOutgroup()
,
ImposeConstraint()
,
KeptPaths()
,
KeptVerts()
,
MakeTreeBinary()
,
Renumber()
,
RenumberTips()
,
RenumberTree()
,
RootTree()
,
SortTree()
,
Subtree()
,
TipTimedTree()
,
TrivialTree
tree <- PectinateTree(8)
plot(LeafLabelInterchange(tree, 3L))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.