newick_to_edges: Turn a newick format tree to a matrix of edges

newick_to_edgesR Documentation

Turn a newick format tree to a matrix of edges

Description

Turn a newick format tree to a matrix of edges

Usage

newick_to_edges(newick, node = "R", edgemat = matrix(NA, 0, 2))

Arguments

newick

Tree in newick format.

node

Root label of the tree.

edgemat

Used for recursive function calls.

Value

Tree as two column matrix of edges (adjacency list)

Examples

newick = random_newick(c('a', 'b', 'c', 'd'))
newick
newick_to_edges(newick)

uqrmaie1/admixtools documentation built on Nov. 3, 2024, 12:56 a.m.