How to Make a Heatmap of Customers in R [Video]

[This article was first published on, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

The ggplot2 package is an essential tool in every data scientists toolkit. Today we show you how to use ggplot2 to make a professional heatmap that organizes customers by their sales purchasing habits.

R-Tips Weekly

This article is part of R-Tips Weekly, a weekly video tutorial that shows you step-by-step how to do common R coding tasks.

Here are the links to get set up. ?

Video Tutorial

Watch this video to learn how to make a Customer Heatmap in ggplot2. Click the image to play the tutorial.

(Click image to play tutorial)

What You Make in this R-Tip

By the end of this tutorial, you will have created this Customer Heatmap showing purchasing preferences.

Customer Heatmap in ggplot2


You just created a Customer Heatmap using ggplot2. This is great, but there’s a lot more to learning data science.

If you’d like to learn data visualizations, data wrangling, shiny apps, and data science for business with R, then read on. ?

My Struggles with Learning Data Science

It took me a long time to learn data science. I made a lot of mistakes as I fumbled through learning R. I specifically had a tough time navigating the ever increasing landscape of tools and packages, trying to pick between R and Python, and getting lost along the way.

If you feel like this, you’re not alone. Coding is tough, data science is tough, and connecting it all with the business is tough.

If you feel like this, you’re not alone.

The good news is that, after years of learning, I was able to become a highly-rated business consultant working with Fortune 500 clients and my career advanced rapidly. More than that, I was able to help others in the community by developing open source software that has been downloaded over 1,000,000 times, and I found a real passion for coding.

In fact, that’s the driving reason that I created Business Science to help people like you and me that are struggling to learn data science for business (You can read about my personal journey here).

What I found out is that:

  1. Data Science does not have to be difficult, it just has to be taught smartly

  2. Anyone can learn data science fast provided they are motivated.

How I can help

If you are interested in learning R and the ecosystem of tools at a deeper level, then I have a streamlined program that will get you past your struggles and improve your career in the process.

It’s called the 5-Course R-Track System. It’s an integrated system containing 5 courses that work together on a learning path. Through 5+ projects, you learn everything you need to help your organization: from data science foundations, to advanced machine learning, to web applications and deployment.

The result is that you break through previous struggles, learning from my experience & our community of 2000+ data scientists that are ready to help you succeed.

Ready to take the next step? Then let’s get started.

To leave a comment for the author, please follow the link and comment on their blog: offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)