View source: R/ImposeConstraint.R
ImposeConstraint | R Documentation |
Modify a tree such that it matches a specified constraint.
This is at present a somewhat crude implementation that attempts to retain
much of the structure of tree
whilst guaranteeing compatibility with
each entry in constraint
.
ImposeConstraint(tree, constraint)
AddUnconstrained(constraint, toAdd, asPhyDat = TRUE)
tree |
A tree of class |
constraint |
Either an object of class |
toAdd |
Character vector specifying taxa to add to constraint. |
asPhyDat |
Logical: if |
ImposeConstraint()
returns a tree of class phylo
, consistent
with constraint
.
AddUnconstrained()
: Expand a constraint to include unconstrained
taxa.
Martin R. Smith (martin.smith@durham.ac.uk)
Other tree manipulation:
AddTip()
,
CollapseNode()
,
ConsensusWithout()
,
DropTip()
,
EnforceOutgroup()
,
KeptPaths()
,
KeptVerts()
,
LeafLabelInterchange()
,
MakeTreeBinary()
,
Renumber()
,
RenumberTips()
,
RenumberTree()
,
RootTree()
,
SortTree()
,
Subtree()
,
TipTimedTree()
,
TrivialTree
tips <- letters[1:9]
tree <- as.phylo(1, 9, tips)
plot(tree)
constraint <- StringToPhyDat("0000?1111 000111111 0000??110", tips, FALSE)
plot(ImposeConstraint(tree, constraint))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.