How to Create a Dendrogram in R Programming

Hierarchical clustering often requires visualization to see associations among data. Here’s how a dendrogram provides that good visualization so that you can understand your data clusters.

Pierre DeBois
11 min readJun 5, 2023

In clustering it sometimes is important to set up a hierarchy displaying which groups of data come together.

This is where dendrogram comes into play. A dendrogram is a set of branches that describes the distance between each observation of a dataset. An observation is represented as a branch of the dendrogram, called a leaf. Each distance determines leaf position in a dendrogram, ranking each observation into a hierarchical cluster as a result.

In this post, I’m going to explain exactly how a dendrogram works within R programming. This post will demonstrate how to create a basic dendrogram graph, how to cut a dendrogram into smaller branches as needed, and how to use color to highlight a dendrogram leaf. Three different types of graph functions are available to create a basic dendrogram in R.

How A Dendrogram Works

To analyze a dendrogram you focus on the height of the leaf and how each leaf is positioned. The longer the line of a leaf, the…

--

--

Pierre DeBois

#analytics |#datascience |#JS |#rstats |#marketing services for #smallbiz | #retail | #nonprofits Contrib @CMSWire @smallbiztrends #blackbusiness #BLM