plot_tree | R Documentation |
Plot MRtree results as a dendrogram. If reference labels are provided, a pie chart is shown at each tree node, giving the label proprotions for respective cluster.
plot_tree( labelmat, ref.labels = NULL, show.ref.labels = TRUE, label.order = NULL, node.size = 0.2, cols = NULL, plot.piechart = TRUE, tip.labels = NULL, tip.label.dist = 4, show.branch.labels = FALSE, branch.label.dist = 10, flip.branch = NULL, legend.title = "", bottom.margin = 25 )
labelmat |
a n by m label matrix, provided by the ouput of |
ref.labels |
a factor or characteristic vector specifying the reference labels of n data points |
show.ref.labels |
boolean, whether to show the labels of major type at tree nodes and tips |
label.order |
a vector specifying the order of labels for default colors |
node.size |
scalar, the size of the pie chart / node |
cols |
a vector of colors, one per each label. If not provided, use the default colors. |
plot.piechart |
boolean, whether to draw the pie chart for each tree node. |
tip.labels |
a vector of strings specifying the labels of tree leafs. The labels should align with the order of leaf in the plot. |
tip.label.dist |
vertical distance of the tip labels to the tree tips |
show.branch.labels |
boolean, whether to show the branch labels for convenience of flipping branches |
branch.label.dist |
vertical distance from branch node labels to the node |
flip.branch |
a list of vectors each of size 2, indicating the branch labels to flip. Each time two branches are flipped. |
legend.title |
string as legend title. Empty string by default. |
bottom.margin |
size of the bottom margin, need to be adjusted to show the full labels. |
data("clust_example") out = mrtree(clust_example$clusterings) plot_tree(labelmat = out$labelmat.mrtree, ref.labels = clust_example$ref.labels, plot.piechart = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.