match_tree_edges: Edge matching function

Description Usage Arguments Details Value Author(s) Examples

View source: R/match_tree_edges.R

Description

Given two trees where one is a pruned version of the other gives matching edges and nodes of pruned tree to original tree.

Usage

1
match_tree_edges(original_tree, pruned_tree)

Arguments

original_tree

A tree in phylo format.

pruned_tree

A tree in phylo format that represents a pruned version of original_tree.

Details

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.

Value

matching_edges

A list of the matching edges.

matching_nodes

A matrix of matching node numbers.

removed_edges

A vector of the removed edges.

Author(s)

Graeme T. Lloyd graemetlloyd@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# 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

Claddis documentation built on Oct. 23, 2020, 8:04 p.m.