| plot_parallel | R Documentation |
Parallel coordinates plot for multivariate data, with lines colored by group.
plot_parallel(data, columns, group, colors = NULL, title = NULL)
data |
data.frame |
columns |
numeric columns to include (indices or names) |
group |
grouping column (index or name) |
colors |
optional vector of colors for groups |
title |
optional title |
Each selected variable becomes a parallel vertical axis and each observation a polyline crossing them, so class separation and multivariate patterns stand out. Variables are standardized per column (z-score) before plotting so axes on different scales are comparable.
returns a ggplot2::ggplot graphic
Inselberg, A. (1985). The plane with parallel coordinates. The Visual Computer, 1(2), 69-91. Wickham, H. (2016). ggplot2: Elegant Graphics for Data Analysis. Springer.
data(iris)
grf <- plot_parallel(iris, columns = 1:4, group = 5)
plot(grf)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.