Hands-on Exercise 5

Visualising and Analysing Multivariate Data

Author

Yee Weicong Mark

Published

May 14, 2026

Modified

May 14, 2026

Overview

This hands-on exercise covers five chapters of the multivariate visualisation toolkit, working from simpler chart types to more complex ones.

The chapters move from simple to complex. Chapter 6 asks questions like “does GDP move up when life expectancy moves up?” by looking at two measurements at a time. Chapter 14 shows the full data as a coloured grid, with one row per country and one column per measurement, so a single glance reveals which countries are high or low across many things at once. Chapter 13 plots each country as a dot inside a triangle, which works when each country has three numbers that add up to a whole (such as young, working-age, and old as shares of the population). Chapter 15 extends this idea to many measurements at once, drawing each country as a zigzag line that crosses parallel vertical axes. Chapter 16 introduces hierarchy by nesting smaller rectangles inside bigger ones, so a property project sits inside a planning area, which sits inside a planning region. Reading the chapters in this order means each one builds on the previous, instead of feeling like five disconnected chart types.

Datasets Used

Four datasets carry across the five chapters:

  1. wine_quality.csv from the UCI Machine Learning Repository, combining red and white wine samples with 13 variables and 6,497 observations
  2. WHData-2018.csv from the World Happiness Report 2018, with country-level happiness scores and explanatory variables
  3. respopagsex2000to2018_tidy.csv from the Singapore Department of Statistics, recording resident population by planning area, subzone, age group, sex, and year from 2000 to 2018
  4. realis2018.csv from the URA REALIS portal, recording private property transactions in Singapore in 2018

Chapters

Chapter 6

Visual Correlation Analysis

Covers pairs(), ggcorrmat(), and corrplot() for visualising how pairs of variables move together.

Open chapter →

Chapter 14

Heatmap for Visualising and Analysing Multivariate Data

Covers heatmap() and heatmaply() for showing the whole dataset as a coloured grid, with optional clustering and seriation.

Open chapter →

Chapter 13

Creating Ternary Plot with R

Covers ggtern() for static ternary plots and plot_ly() for interactive ones, for three-part compositional data.

Open chapter →

Chapter 15

Visual Multivariate Analysis with Parallel Coordinates Plot

Covers ggparcoord() for static parallel coordinates plots and parallelPlot() for interactive D3-based plots.

Open chapter →

Chapter 16

Treemap Visualisation with R

Covers treemap(), treemapify for ggplot2 integration, and d3treeR for drill-down interactivity.

Open chapter →