In this topic, we will look at how R can do other types of clustering, which completes the picture of clustering in Tableau.
Hierarchical modeling is aimed at finding hierarchies of clusters. This facility is available to us in R. To do this, let's use the
Iris dataset with an R script, which will focus on hierarchical clustering. The script is as follows:
IrisSample <- sample(1:dim(iris),40) IrisSample$Species <- NULL dim(IrisSample) hc <- hclust(dist(IrisSample), method="ave") hc plot(hc, hang = -1, labels=iris$Species[IrisSample])
In the following figure we can represent a cluster dendogram, which means the hierarchies of clusters.