order.edges: order.edges

Description Usage Arguments Value Note See Also Examples

View source: R/order.edges.R

Description

Gets the edge index ordered by node (e.g. order by node index). This function is practical for plotting node values on edges instead of nodes.

Usage

1

Arguments

phy

tree, phylo object

Value

numeric vector with edge indices

Note

tree files read by read.beast.annot will include an element with ordered edges: phy$edge.ordered

See Also

edgelabels read.beast.annot

Examples

1
2
3
4
5
6
file <- system.file("data/trees/mcc.tre", package="rBt")
tr <- read.nexus(tr)
nodes <- (length(tr$tip.label)+1):(length(tr$tip.label)+tr$Nnode)
edges.ordered <- order.edges(tr)
plot(tr)
edgelabels(edge=edges.ordered, text=nodes[-1]) # -1 is needed to exclude the root node

santiagosnchez/rBt documentation built on Aug. 9, 2021, 11:52 p.m.