So far in the recipe, we have used hclust to perform agglomerative hierarchical clustering, but if you would like to perform divisive hierarchical clustering, you can use the diana function from the cluster package.
- Install and load the cluster package:
- Then, use diana to perform divisive hierarchical clustering:
dv = diana(proteinIntakeScaled, metric = "euclidean")
- Lastly, plot a dendrogram and banner with the plot function:
Here is the dendrogram using the plot function: