View source: R/MakeEdgeLabels.R
MakeEdgeLabels | R Documentation |
These functions will create edge labels for hierarchy trees.
MakeEdgeLabels(MyHiers, label = "all", missingData = NULL, duplicateEdgeLabels = "oldest") getTipList(phy) whichEdge(phy, taxa) node.leaves(phy, node) node.offspring(phy, node) WhatToDoWithDuplicateEdgeNames(edgeLabels, duplicateEdgeLabels)
MyHiers |
A vector of hier pages OR a list of XMLs as an R object |
label |
Which hierarchical units should be included in the edge labels |
missingData |
If tip taxa are not all the same taxonomic rank, should Reol cleave out taxa or hierarchical rank first |
duplicateEdgeLabels |
Choice of which edge label to prefer: recent, oldest, or combined |
phy |
tree in the class phylo |
taxa |
Vector of tip taxa |
node |
Any node number in the tree |
edgeLabels |
Vector of edge labels with the same associated branch |
Note that edges are slightly different than node labels, in that edges are plotted along the center of the branch rather than at a node. Plotting both is redundant, but one or the other may look better aesthetically. Also edges in the edgeLabels function is not the actual edge number, but the row. Our functions reflect this.
There will likely be cases where edges have more than one hierarchical name (for example, the branch to camel species will have the genus Camelus and the family Camelidae). When making edge labels, you have the choice of using the most recent hierarchical name (genus in the camel example) or the oldest (family in camels), or you can choose to combine the names so that you can see all of them (Camilidae.Camelus).
MakeEdgeLabels
returns a vector of edges and their clade names to be used in apes
edgeLabels function. getTipList
, WhatToDoWithDuplicateEdgeNames
, and
whichEdge
are internal functions for MakeEdgeLabel
.
MakeHierarchyTree
## Not run: data(MyHiers) Tree <- MakeHierarchyTree(MyHiers, includeNodeLabels=FALSE) dges <- MakeEdgeLabels(MyHiers) plot(Tree, show.node.label=FALSE) edgelabels(text=names(edges), edge=edges) edges <- MakeEdgeLabels(MyHiers, missingData="pruneTaxa", duplicateEdgeLabels="recent") plot(Tree, show.node.label=FALSE) edgelabels(text=names(edges), edge=edges) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.