Learn R Programming

treeDbalance (version 1.2.0)

extractTopology: Extract the non-3D topology of trees in phylo(3D) format

Description

extractTopology - Extracts the topology of a rooted tree in phylo or phylo3D format by ignoring edge subdivisions, i.e. nodes with both in- and out-degree of 1. The nodes have to be enumerated from 1 to \(|V|\) (otherwise use enum2_1toV()).
The function works for trees in phylo as well as phylo3D format as existing information on the coordinates or edge weights is dropped anyway.
Edge lengths in the topology are based on the sum of the edge lengths of the corresponding paths in the original tree.

Usage

extractTopology(tree)

Value

extractTopology(tree) Tree in phylo format with cladewise node enumeration in which all interior nodes have at least out-degree 2.

Arguments

tree

A rooted tree in (extended) phylo(3D) format (no special node enumeration required, except that nodes are numbered from 1 to |V| = the total number of nodes). There must be at least 2 nodes, i.e. one edge.

Author

Sophie Kersting, Luise Kühn

Examples

Run this code
tree <- treeDbalance::example3Dtrees$bean09
top <- extractTopology(tree)

Run the code above in your browser using DataLab