| KeptVerts {TreeTools} | 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(),
RenumberTips(),
RenumberTree(),
Renumber(),
RootTree(),
SingleTaxonTree(),
SortTree(),
Subtree()
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.