View source: R/match_tree_edges.R
| match_tree_edges | R Documentation | 
Given two trees where one is a pruned version of the other gives matching edges and nodes of pruned tree to original tree.
match_tree_edges(original_tree, pruned_tree)
original_tree | 
 A tree in phylo format.  | 
pruned_tree | 
 A tree in phylo format that represents a pruned version of   | 
Finds matching edge(s) and node(s) for a pruned tree in the original tree from which it was created. This is intended as an internal function, but may be of use to someone.
matching_edges | 
 A list of the matching edges.  | 
matching_nodes | 
 A matrix of matching node numbers.  | 
removed_edges | 
 A vector of the removed edges.  | 
Graeme T. Lloyd graemetlloyd@gmail.com
# Create a random 10-taxon tree:
original_tree <- ape::rtree(n = 10)
# Remove three leaves:
pruned_tree <- ape::drop.tip(phy = original_tree, tip = c("t1", "t3", "t8"))
# Find matching edges:
X <- match_tree_edges(original_tree, pruned_tree)
# Show matching edges:
X$matching_edges
# Show matching nodes:
X$matching_nodes
# Show removed edges:
X$removed_edges
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.