We use the R dataset iris.
library(datasets)
data <- iris
iris format :
A data frame with 150 observations on the following 5 variables :
Sepal.Length
Sepal.Width
Petal.length
Petal.Width
Species
#Head of dataset
knitr::kable(head(iris,8), align = "l")| Sepal.Length | Sepal.Width | Petal.Length | Petal.Width | Species |
|---|---|---|---|---|
| 5.1 | 3.5 | 1.4 | 0.2 | setosa |
| 4.9 | 3.0 | 1.4 | 0.2 | setosa |
| 4.7 | 3.2 | 1.3 | 0.2 | setosa |
| 4.6 | 3.1 | 1.5 | 0.2 | setosa |
| 5.0 | 3.6 | 1.4 | 0.2 | setosa |
| 5.4 | 3.9 | 1.7 | 0.4 | setosa |
| 4.6 | 3.4 | 1.4 | 0.3 | setosa |
| 5.0 | 3.4 | 1.5 | 0.2 | setosa |
ggparcoord() functionggparcoord(
data, Dataset to plot
columns, A vector of variables to be axes in the plot
groupColumn = NULL, a single variable to group (color) by
scale = "std", Method used to scale the variables
scaleSummary = "mean", if scale=="center", summary statistic to univariately center each variable by
centerObsID = 1, If scale=="centerObs", row number of case plot should univariately be centered on
missing = "exclude", Method used to handle missing values
order = columns, Method used to order the axes
showPoints = FALSE, logical operator indicating whether points should be plotted or not
splineFactor = FALSE, Logical or numeric operator indicating whether spline interpolation should be used
alphaLines = 1, Value of alpha scaler for the lines of the parcoord plot or a column name of the data
boxplot = FALSE, Logical operator indicating whether or not boxplots should underlay the distribution of each variable
shadeBox = NULL, Color of underlying box which extends from the min to the max for each variable
mapping = NULL, aes string to pass to ggplot object
title, Character string denoting the title of the plot
)
This document is a work by Emma Lafaurie (emma.lafaurie@inserm.fr) for the SBIM (Service de Biostatistique et Information Médicale) at Saint-Louis Hospital in Paris.
Based on the template of Yan Holtz.