branch_singles {ggmuller} | R Documentation |
Add branches of length zero to get rid of single nodes in an adjacency matrix
Description
Single nodes are those with exactly one daughter. This function is required by adj_matrix_to_tree, since valid "phylo" objects cannot contain single nodes. If pre-existing branches lack lengths then these are set to 1.
Usage
branch_singles(edges)
Arguments
edges |
Dataframe comprising an adjacency matrix, with column names "Parent" and "Identity" |
Value
A dataframe comprising the augmented adjacency matrix.
Author(s)
Rob Noble, robjohnnoble@gmail.com
Examples
edges1 <- data.frame(Parent = c(1,1,1,3), Identity = 2:5)
branch_singles(edges1)
[Package ggmuller version 0.5.6 Index]