ggpairs | R Documentation |
Plot multiple axes of a data frame or a fortified dimension reduction.
ggpairs(
df_data,
group = NULL,
axes = 1:2,
variables = FALSE,
n_vars = 0,
ellipses = FALSE,
...,
title = NULL,
colors = if (!is.null(group)) nice_palette(df_data[[group]])
)
df_data |
Data frame |
group |
Column name of the grouping of observations |
axes |
Axes to plot. If more than 2, plots all pair combinations |
variables |
Logical, plot variable contributions of the dimension reduction to the selected axes, only for 2 axes |
n_vars |
Maximum number of variable contributions to plot. By default 0, for all variables. |
ellipses |
Logical, plot ellipses of groups |
... |
Passed to ggplot2 stat_ellipse if ellipses are requested |
title |
String to add as title, default NULL |
colors |
Vector of colors for each group |
ggmatrix
fortify_pca, fortify_ica
df_pca <- fortify_pca(iris[-5])
ggpairs(df_pca)
df_pca <- fortify_pca(iris[-5], sup_vars = iris[5])
ggpairs(df_pca, group = 'Species', ellipses = TRUE, variables = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.