dend.plot {nomclust} | R Documentation |
The function dend.plot()
visualizes the hierarchy of clusters using a dendrogram. The function also enables a user to mark the individual clusters with colors.
The number of displayed clusters can be defined either by a user or by one of the five evaluation criteria.
dend.plot( x, clusters = "BIC", style = "greys", colorful = TRUE, clu.col = NA, main = "Dendrogram", ac = TRUE, ... )
x |
An output of the |
clusters |
Either a numeric value or a character string with the name of the evaluation criterion expressing the number of displayed clusters in a dendrogram. The following evaluation criteria can be used: |
style |
A character string or a vector of colors defines a graphical style of the produced plots. There are two predefined styles in the nomclust package, namely |
colorful |
A logical argument specifying if the output will be colorful or black and white. |
clu.col |
An optional vector of colors which allows a researcher to apply user-defined colors for displayed (marked) clusters in a dendrogram. |
main |
A character string with the chart title. |
ac |
A logical argument indicating if an agglomerative coefficient will be present in the output. |
... |
Other graphical arguments compatible with the generic |
The function can be applied to a nomclust()
or nomprox()
output containing the dend
component. This component is not available when the optimization process is used.
The function returns a dendrogram describing the hierarchy of clusters that can help to identify the optimal number of clusters.
Jana Cibulkova and Zdenek Sulc.
Contact: jana.cibulkova@vse.cz
# sample data data(data20) # creating an object with results of hierarchical clustering hca.object <- nomclust(data20, measure = "iof", eval = TRUE, opt = FALSE) # a basic plot dend.plot(hca.object) # a dendrogram with color-coded clusters according to the BIC index dend.plot(hca.object, clusters = "BIC", colorful = TRUE) # using a dark style and specifying own colors in a solution with three clusters dend.plot(hca.object, clusters = 3, style = "dark", clu.col = c("blue", "red", "green")) # a black and white dendrogram dend.plot(hca.object, clusters = 3, style = "dark", colorful = FALSE)