Clustering without using k-means

Now, Tableau can only do k-Means clustering. On the other hand, R can offer a variety of other clustering methodologies, such as hierarchical clustering.

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

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)[1],40)
IrisSample$Species <- NULL

dim(IrisSample)
hc <- hclust(dist(IrisSample), method="ave")
hc

plot(hc, hang = -1, labels=iris$Species[IrisSample])

In the ...

Get Advanced Analytics with R and Tableau now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.