Description Usage Arguments Details Value Examples
The function will plot the dendrogram, with different colors for different clusters.
1 | HGC.PlotDendrogram(tree, k, plot.label, labels)
|
tree |
the input clustering tree saved as |
k |
the number of clusters to cut the tree into. |
plot.label |
a bool variable. It decides whether the function will add color bars. |
labels |
a data frame or a matrix to store the label information. Different labels should be in different columns and the users should name the columns correspondingly. The label information will show in the figure as color bars below the dendrogram, and each label takes one color bar. |
The function plots the clustering tree, with alternative colors showing
the clustering results and the label information. It is based on the R
package dendextend
which contains many parameters for the
visualization. For users' convenience, most of the parameters are set to
be the default value. Advanced users could
visit the vignette of dendextend
for more flexible visualization.
The function will return 1 if the dendrogram is successfully drawn.
1 2 3 4 5 6 7 8 9 10 11 12 | data(Pollen)
Pollen.PCs <- Pollen[["PCs"]]
Pollen.Label.Tissue <- Pollen[["Tissue"]]
Pollen.Label.CellLine <- Pollen[["CellLine"]]
Pollen.SNN <- SNN.Construction(Pollen.PCs)
Pollen.ClusteringTree <- HGC.dendrogram(G = Pollen.SNN)
Pollen.labels <- data.frame(Tissue = Pollen.Label.Tissue,
CellLine = Pollen.Label.CellLine)
HGC.PlotDendrogram(tree = Pollen.ClusteringTree,
k = 5, plot.label = TRUE,
labels = Pollen.labels)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.