R/sjPlotClusterAnalysis.R
sjc.dend.Rd
Computes a hierarchical cluster analysis and plots a hierarchical
dendrogram with highlighted rectangles around the classified groups.
Can be used, for instance, as visual tool to verify the elbow-criterion
(see sjc.elbow
).
sjc.dend(data, groupcount, distance = "euclidean", agglomeration = "ward")
data | A data frame with variables that should be used for the cluster analysis. |
---|---|
groupcount | The amount of groups (clusters) that should be used.
Solutions for multiple cluster groups can be plotted, for instance with |
distance | Distance measure to be used when |
agglomeration | Agglomeration method to be used when |
Since R version > 3.0.3, the "ward"
option has
been replaced by either "ward.D"
or "ward.D2"
,
so you may use one of these values. When using "ward"
,
it will be replaced by "ward.D2"
.
# Plot dendrogram of hierarchical clustering of mtcars-dataset # and show group classification sjc.dend(mtcars, 5)# Plot dendrogram of hierarchical clustering of mtcars-dataset # and show group classification for 2 to 4 groups sjc.dend(mtcars, 2:4)