Description Usage Arguments Value Note See Also Examples
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.
1 | order.edges(phy)
|
phy |
tree, |
numeric
vector with edge indices
tree files read by read.beast.annot
will include an
element with ordered edges: phy$edge.ordered
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.