Build a parallel coordinates plot to compare health indicators across multiple countries.
Introduction:
Health indicators are important measures that reflect the overall well-being and development of a country. Comparing multiple indicators helps identify patterns and differences between countries. In this report, a parallel coordinates plot is used to visualize and compare health indicators across multiple countries.
Objective:
To analyze and compare key health indicators such as life expectancy, infant mortality, GDP per capital, and health expenditure using R programming.
Step 1: Load required pacakges
library(GGally)
Warning: package 'GGally' was built under R version 4.5.3
Loading required package: ggplot2
Warning: package 'ggplot2' was built under R version 4.5.3
library(dplyr)
Warning: package 'dplyr' was built under R version 4.5.3
Attaching package: 'dplyr'
The following objects are masked from 'package:stats':
filter, lag
The following objects are masked from 'package:base':
intersect, setdiff, setequal, union
library(ggplot2)
Step 2: Load dataset
data <-read.csv(file.choose(), stringsAsFactors =FALSE, encoding ="latin1")head(data)
InvoiceNo StockCode Description Quantity
1 536365 85123A WHITE HANGING HEART T-LIGHT HOLDER 6
2 536365 71053 WHITE METAL LANTERN 6
3 536365 84406B CREAM CUPID HEARTS COAT HANGER 8
4 536365 84029G KNITTED UNION FLAG HOT WATER BOTTLE 6
5 536365 84029E RED WOOLLY HOTTIE WHITE HEART. 6
6 536365 22752 SET 7 BABUSHKA NESTING BOXES 2
InvoiceDate UnitPrice CustomerID Country
1 12/1/2010 8:26 2.55 17850 United Kingdom
2 12/1/2010 8:26 3.39 17850 United Kingdom
3 12/1/2010 8:26 2.75 17850 United Kingdom
4 12/1/2010 8:26 3.39 17850 United Kingdom
5 12/1/2010 8:26 3.39 17850 United Kingdom
6 12/1/2010 8:26 7.65 17850 United Kingdom