| KeptVerts | R Documentation |
Identify vertices retained when leaves are dropped
KeptVerts(tree, keptTips, tipLabels = TipLabels(tree))
## S3 method for class 'phylo'
KeptVerts(tree, keptTips, tipLabels = TipLabels(tree))
## S3 method for class 'numeric'
KeptVerts(tree, keptTips, tipLabels = TipLabels(tree))
tree |
Original tree of class |
keptTips |
Either:
|
tipLabels |
Optional character vector naming the leaves of |
Martin R. Smith (martin.smith@durham.ac.uk)
Other tree manipulation:
AddTip(),
CollapseNode(),
ConsensusWithout(),
DropTip(),
EnforceOutgroup(),
ImposeConstraint(),
KeptPaths(),
LeafLabelInterchange(),
MakeTreeBinary(),
Renumber(),
RenumberTips(),
RenumberTree(),
RootTree(),
SortTree(),
Subtree(),
TipTimedTree(),
TrivialTree
master <- BalancedTree(12)
master <- Preorder(master) # Nodes must be listed in Preorder sequence
plot(master)
nodelabels()
allTips <- master[["tip.label"]]
keptTips <- sample(allTips, 8)
plot(KeepTip(master, keptTips))
kept <- KeptVerts(master, allTips %in% keptTips)
map <- which(kept)
# Node `i` in the reduced tree corresponds to node `map[i]` in the original.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.